This question was
closed Mar 18, 2018 at 02:03 PM by
S_jay1 for the following reason:
No Answer.
Question by
S_jay1 · Feb 27, 2018 at 08:58 PM ·
collisionplayerontriggerenter
Trigger only activates when player collides on y axis
I want to make it so that a player only gets destroyed when they collide with a certain game object on the y-axis. If the player touches the game object on the other sides, I don't want it to do anything. However, if the game object falls on the player, I want the player to be destroyed. How would I do this? This is my script right now, but it is just a basic collision script:
void OnTriggerEnter(Collider other) {
Destroy(other.gameObject);
}
Would I need to create a different collider and attach it to the player?
Comment
Follow this Question
Related Questions
Error after building on Android 0 Answers
Not detecting collision 1 Answer
Invisible objects appear after collision 2 Answers
OnTrigger Problems Between Colliders Issue 1 Answer
Collision occurs but nothing happens? 0 Answers