Question by
GordonArber · Jun 02, 2018 at 09:12 PM ·
rigidbodycolliderontriggerenterinventoryinventory system
OnTriggerEnter called second time with rigidbody
Hey Guys, I am very new at Unity and trying to figure out why this code works great before I add a rigidbody, but once I add the rigidbody it is called twice.
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Item")
{
inventory.AddItem(other.GetComponent<Item>());
}
}
Comment
Answer by tormentoarmagedoom · Jun 06, 2018 at 11:01 AM
Good day.
If is called twice is for one of this reasons:
There are 2 scripts doing the same The collider enters, then exits, and then enters again
Bye.
Your answer
Follow this Question
Related Questions
OnTriggerEnter no longer works 1 Answer
Character doesn't collide with the floor. 0 Answers
Move NPC on triggerEnter 0 Answers