- Home /
Jumping on top of an enemy problem
Hello, I have a Player parent object with a character controller and various child objects and a similar enemy with a box collider.
I'm struggling to differentiate between the collision happening when the player walks into the enemy and when the the player jumps and collides with it from above.
I've tried tagging the child objects but they don't have colliders and if I add them it messes up my character movement. I've also tried to test the position of the player:
if(col.transform.position.y >= transform.position.y){ killThyself(); }
But this doesn't work either - should I add the height of the enemy? If so how do I do that?
Any suggestions happily received.
Answer by slidecoast · May 25, 2013 at 09:13 AM
You have to use OnTriggerEnter function to jump on enemies.
Your answer
Follow this Question
Related Questions
Box collider didn't jump with player 1 Answer
How can i make a projectile attack travel through multiple enemies dealing damage to all of them? 1 Answer
Enemy Detection Area 1 Answer
Translate Jump Trigger Collision Issue 1 Answer
How can I stop my player from jumping off of vertical surfaces? 0 Answers