Hi, this is my code lines:
When the player collides with the tree, the ‘move away’ function works and prevent them from overlapping. But I think the fact of the camera is centered on player, makes the screen shakes when the player ‘forces’ to walk through the tree.
How do I avoid the screen from shaking?
I hope I’ve been clear about my doubt.
Thanks a lot!
MrMen
January 27, 2022, 8:38pm
2
Swap the centre camera on player and the move player events. So you move the player first and then centre the camera.
Basically adding a condition on center camera action? Only when player is moving?
Not sure if I got it on practice. Sorry.
MrMen
January 27, 2022, 8:41pm
4
No, swap the two events in your screen snip around - so you do the move player events first, then the last event will be centre camera on player…
I had no idea that order matters.
I will try it tomorrow and give the fback!
Thanks again!
MrMen
January 27, 2022, 9:01pm
6
My general rule of thumb is to work out the all positions first, and move the camera as the very last action.
2 Likes
Just to add on MrMen, order matters ALOT in gdev. The engine essentially reads top to bottom.
2 Likes
Thanks, very useful info!
It worked!
Thanks a lot again!