- Home /
How to Add a Decal When a Rigidbody Collides with a Surface?
I am making a game where I shoot balls, in a completely black room. The ball is a guideline to help the player finish the level. I want to add a decal when the ball hit the surface. Any suggestions? I am not good at coding. Thanks :)
Comment
Best Answer
Answer by RadJor64 · Feb 19, 2014 at 01:31 AM
Create a prefab for the decal. Then in a script, when the ball collides with something, Instantiate() the prefab at the point where the collision takes place.
If you are using OnCollisionEnter (Collision theColl) to check for collision, then the point of contact is theColl.contacts[0].