- Home /
Enemy following Player on uneven surface
Hi all!
I managed to make an enemy(character controller attached) follow the player on an even surface. Basically, I animate based on the difference of positions between them:
Player.transform.position - enemy.transform.position
But, on uneven terrains or levels it moves toward the player THRU or flying over them instead of moving on it. does anyone know how to get over this problem?
Thanks in advance.
Answer by The_r0nin · Nov 21, 2010 at 02:19 PM
Are you using controller.Move()? If you simply move the transform of your enemy, it will ignore any collisions. But if you use controller.Move(), the collisions are handled by the character controller. I made this mistake myself, not too long ago...
Please click the check mark next to the answer, so it is logged as answered (so other people who are searching similar problems will know this post is helpful).
loginuhahaha would you $$anonymous$$d sharing the code? Thanks :).