- Home /
OnTriggerEnter only called at start
Does this function need to be called in the update function? If so, what parameter do you pass with multiple possible objects? If something spawns at its location, this works, but other than that it fails.
function OnTriggerEnter(other : Collider)
{
if(other.gameObject.tag == "theone")
{
//transfer information
}
}
can't get what you've ment in the second part of the question
thanks. that fixed it. the collider was in sleep and added rigid bodies to the others.
That gets me all the time :) Will convert my comment to an answer
Answer by whydoidoit · Sep 28, 2012 at 08:18 PM
You don't need to call OnTriggerEnter, it's called for you - but you do need at least one of the things involved to have a rigidbody attached that is not sleeping.
Answer by john_yarko · Sep 28, 2012 at 08:31 PM
this function is called automatically when the object(to which this script is attached) enters the collision. at least one of the colliding objects should have a Rigidbody attached.
Answer by HotPhone · Sep 21, 2014 at 10:39 AM
I had the same problem. I have moved the object which enters the trigger with transform. You have to move the object with velocity instead for it to work.
Your answer
Follow this Question
Related Questions
How Does OnTriggerEnter() Work? 0 Answers
Can't call GetKey inside OnTriggerEnter? 2 Answers
Hello, How would one make a particlesystem activate triggers? (hopefully I worded that right) 0 Answers
OnTriggerEnter/Exit not working 1 Answer
Trigger in child object calls OnTriggerEnter in parent object 3 Answers