- Home /
How to make objects collide once
Hi guys,
I have objects that look like square.(have collider and rigidbody)
I want those squares to make a sound when I hit these squares with an object. But just once(once for scene). If I hit one of the squares again, ıt shouldn't make sound. How could I do this ?
Thanks advance !
Answer by DevManuel · Feb 17, 2021 at 05:59 PM
You have to use a raycast. Then when the raycast is triggered, you check an bool-var, if the sound is already played.
Your answer
Follow this Question
Related Questions
OnCollisionEnter being called without the colliders actually colliding 1 Answer
Collision detection when no collision happens,OnCollision is called without a collision 1 Answer
collisions not detected 1 Answer
How to detect when and where a particle hits a surface? 4 Answers
Another Collision Question 3 Answers