# Enemy Game Object stops moving

**URL:** <https://forum.defold.com/t/enemy-game-object-stops-moving/68409>\
**Category:** Questions\
**Created:** [May 11, 2021, 4:31pm UTC](https://forum.defold.com/t/enemy-game-object-stops-moving/68409 "2021-05-11T16:31:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charlie-Bloomfield](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/charlie-bloomfield/32/24669_2.png) [@Charlie-Bloomfield](https://forum.defold.com/u/Charlie-Bloomfield)\
**Post date:** [May 11, 2021, 4:31pm UTC](https://forum.defold.com/t/enemy-game-object-stops-moving/68409/1 "2021-05-11T16:31:18Z")

</div>

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](https://forum.defold.com/uploads/default/original/3X/9/f/9f8f65e036177220624b71c7eb5d23d8367beb4b.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](https://forum-defold.b-cdn.net/uploads/default/original/3X/8/0/80a2f50d05b63c95715139aa0f8eac6b8c8cf798.jpeg)  
Please let me know if you need more information

Thank you

---

<div class="post-metadata">

**Author:** ![WhiteBoxDev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/whiteboxdev/32/36080_2.png) [@WhiteBoxDev](https://forum.defold.com/u/WhiteBoxDev)\
**Post date:** [May 11, 2021, 5:27pm UTC](https://forum.defold.com/t/enemy-game-object-stops-moving/68409/2 "2021-05-11T17:27:41Z")

</div>

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

> [@Wall-clipping collision issue](https://forum.defold.com/t/wall-clipping-collision-issue/66443/2):
>
> Yes, this is an super common issue and has come up dozens of times: [https://forum.defold.com/t/merge-tile-colliders/64339/2](https://forum.defold.com/t/merge-tile-colliders/64339/2)[https://forum.defold.com/t/smoother-gameplay-steering-player-without-stuck-at-collisions/11656](https://forum.defold.com/t/smoother-gameplay-steering-player-without-stuck-at-collisions/11656) Good explanation: [https://forum.defold.com/t/directional-platforms-help/18764/31](https://forum.defold.com/t/directional-platforms-help/18764/31) You’re better off using raycasts for platforming collisions rather than collision shapes. Check it out here: [https://defold.com/examples/physics/raycast/](https://defold.com/examples/physics/raycast/)[https://defold.com/ref/physics/](https://defold.com/ref/physics/) There …

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [May 11, 2021, 6:35pm UTC](https://forum.defold.com/t/enemy-game-object-stops-moving/68409/3 "2021-05-11T18:35:13Z")

</div>

> [@WhiteBoxDev](#):
>
> use raycasts instead of collision shapes

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.

---

<div class="post-metadata">

**Author:** ![Charlie-Bloomfield](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/charlie-bloomfield/32/24669_2.png) [@Charlie-Bloomfield](https://forum.defold.com/u/Charlie-Bloomfield)\
**Post date:** [May 12, 2021, 4:19pm UTC](https://forum.defold.com/t/enemy-game-object-stops-moving/68409/4 "2021-05-12T16:19:22Z")

</div>

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!
