Smooth rotations and an issue solved.


Hi there! This week I fixed a pretty glaring control issue.

In Project Coastal, the camera can be rotated 360 degrees orbiting around the player. This introduces some complexity to your standard XYZ setup because the user's cardinal direction needs to be thought about very carefully before implementation. Previously, the player had a dynamic North - that is, if the camera is changed, the player's North changes. This introduced this error when you move North, stop, swing the camera around to the South and then try to keep moving:

Bug when beginning to move in old implementation

At this point, the player is pointed North, but when swinging the camera around to face the player and then moving, North is now behind the player. So the player dutifully flicks around to fulfil the Coroutine that runs to calculate the rotation back to face South.

Now in the new version, the player's North is static. If the player is running across the screen with the camera to the East, it looks like the player is running East now, but to the game, they're still moving to the North.




Thanks for reading! Hopefully this wasn't too dry, and can help you in your endeavours too. See you next time.


- Ryan

Leave a comment

Log in with itch.io to leave a comment.