- Home /
OnTriggerEnter not functioning
I have a car as my player controller and it has a rigidbody attached to it. I am currently trying to get my car to get relocated or transformed to a different location upon entering a box collider. The box collider has the trigger check box clicked and has a spawn as the location for the car to me teleported.
This is the code I am using.
#pragma strict
var destination : Transform;
function OnTriggerEnter(other : Collider) {
if (other.tag == "Player") {
other.transform.position = destination.position;
}
}
I added a RigidbodyFPS Controller and added the player tag to it. The code works with the fpscontroller just not with my car that is also labeled as player and has a rigidbody.
Is there anyway to make it so my car will work?
Your answer
Follow this Question
Related Questions
When I Play..Framerate is 1.5!!! 3 Answers
How can I get a responsive rigidbody FPS controller without acceleration that reacts to forces? 2 Answers
How do I add force To rigidbody based On Character's Walking direction? 0 Answers
Need Help in FPS controller based on Rigidbody 0 Answers
Enter Car On KeyDown 1 Answer