Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Enemy Cube going through walls.

$
0
0
I've been making a game and recently I lost a lot of work so have been rebuilding. However for some reason the enemy cubes now goes straight through the map to get to me, rather than navigating it. This is the script I have var rotation = Quaternion.LookRotation(Target.position - transform.position); Distance = Vector3.Distance(Target.position, transform.position); transform.rotation = Quaternion.Slerp(transform.rotation, rotation, Time.deltaTime * Damping); transform.position += transform.forward * Speed * Time.deltaTime; The Map has a Mesh Collider and the Cube has a Box Collider. I tried adding a RigidBody to the cube but had no luck. Any help would be appreciated.

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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