• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTC by Mehah - smooth camera move?

Kobuz

New Member
Joined
Apr 15, 2022
Messages
6
Reaction score
2
Hi, I recently came back to OT development and I’m having trouble implementing a smooth dash effect.


My idea is simple:
  1. Use setCameraPosition() on the player's current position. (so i can move camera maually)
  2. Teleport the player 3 tiles to the right.
  3. Move the camera smoothly 96 pixels to the right (with a 50ms delay).
  4. Call followCreature() to restore normal camera tracking.

However, when I use:
Code:
void movePixels(int x, int y) { m_mapView->move(x, y); }

Moving the camera by small increments (e.g., 8px) causes the screen to go black. The game only updates properly when I reach 32px, which I assume is when the camera position actually changes. It seems like the loop starts over again.

I also have an increased visibleDimension:
Bez tytułu.webp


Can someone guide me on how to make this work smoothly? Or maybe it's ready solution in OTC?
Attaching camera to the player during teleport, just like when walking, would be the best option.
 
I assume movePixels is tied to isFollowingCreature, which if there is no isFollowingCreature something may be going wrong and you may need to adapt those parts, have a look into that maybe that can help you ;)
 
Back
Top