- Home /
The question is answered, right answer was accepted
Collision script don't work.
Hello, I have some difficulties with simple script to when player move inside or touch one cube it play a song. I have tryed many and many tutorials and nothing work. I have tryed simplest script with debug (like on linked images) and never it enter in function.
Please help me ! Regards
Trigger Cube Object Trigger Cube Script Collider Cube Object Collider Cube Script
Dont call your script Collision. That class already exists!!!
Even class renamed (and no collision word in script) that is not working.
Answer by tanoshimi · Nov 20, 2014 at 10:11 AM
You also need a (non-kinematic) rigidbody component and collider component on the thing that is colliding with the cube.
I have put rigidbody on the cube the case 'is $$anonymous$$inematic' is not set. Don't work.
I have put rigidbody and the case 'is $$anonymous$$inematic' is not set. Don't work either.
Answer by Dunan · Nov 20, 2014 at 12:40 PM
Oh !
I have add Destroy(gameObject);
And debug is trigger and my cube disapear.
Follow this Question
Related Questions
rigidbody.AddForce(transform.forward * 5000) 1 Answer
simple collision not working 1 Answer
Why rigidbody2D.velocity passing through collider2d boundary but not rigidbody2D.AddForce 1 Answer
Detecting the right time to play a landing animation? 2 Answers
How to make a RigidBody move in a certain direction 1 Answer