Enemy Game Object stops moving

Hi all !

im relativity new to Defold and im trying to get a enemy game object to move across the tile map. The game object will spawn make collision with the tile map , and start to move but then will become stationary as if its colliding with a wall and I cant figure out why. The text file below is the enemy Movements script im using and that is attacked to the enemy game object.

skeletonMovementsScript.txt (3.1 KB)

The image below is a snapshot of two enemy skeletons (on the left and right) after moving and have become stationary with the physics debugger on.
code3
Please let me know if you need more information

Thank you

Hi! This is a very common issue. Check my response and solution here: (use raycasts instead of collision shapes)

2 Likes

Raycasts are guaranteed to solve your problems, but you could also try to change from a box shape to a sphere as the sphere isn’t likely to get stuck on an edge.

3 Likes

Thank you for replying I have solved the issue using a different collision shape however in the future if I come across this issue again ill use raycasting as im still trying to get my head around it.

Thanks for all your help!