Quantcast
Channel: Latest Questions by LlamaNervous
Viewing all articles
Browse latest Browse all 48

Enemy won't collide with walls using transform.Translate

$
0
0
I have an enemy that rushes towards the player inside a small room (game is 2d). The enemy is a cube and has a child cube that acts as it's collider for me. When the enemy runs past or through the player and goes towards a wall it just clips through the wall but when the enemy stops in the room and the player moves towards him the collider works and the player can't clip through it. I was wondering if there was an alternate to transform.Translate that would work in my position. if(Move) { transform.Translate(Vector3.forward * speed * Time.deltaTime); }

Viewing all articles
Browse latest Browse all 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>