August 16, 2022, 12:21pm
I am new to GDevelop and although used some game engines and programming languages I am still getting use to the layout and interface.
My main question here, which I search around with little success, is how do I make a character or sprite move to the location where I have clicked in the scene and keeping the sprites animation correct during its path to where it is heading,
August 16, 2022, 12:34pm
Try the “Add a force to move towards a position” action, and use MouseX() and MouseY() as the position to move towards.
August 16, 2022, 12:43pm
Aside from what has been suggested by BWPanda you can have a look at this page to understand how to move sprites:
How to move objects in your game [GDevelop wiki]
If you are just starting out it is anyway recommendable to make one or two of the tutorial projects
GDevelop 5 tutorials [GDevelop wiki] just to understand how the engine works.
There is also a page full of starters and examples which also include the logic that you need for having the right animation for your sprite
Game examples and templates made with GDevelop | GDevelop
August 16, 2022, 9:30pm
@tcs , there are 2 main ways :
If there are obstacles in the way that should be avoided, look into the PathFinding behaviour.
If it’s a straight line to the mouse click, then look into the Tween behaviour, and use the positional tween action.
Using a force towards the mouse position won’t stop it at the click position.