- Home /
Rigidbody not colliding...? or is my code wrong?
So I am making a top-down shooter, and I have a shell ejection system. I want to have a little shell tinkling sound play every time a shell collides with something. I have a rigidbody on the shell (so it can collide and bounce around, of course) and I have a script that should be playing the sound on collision. But it doesn't. Any idea why?
void OnCollisionEnter (Collision collision)
{
print("Object has collided.");
print("Sound successfully played.");
Shells.Play();
}
It doesn't even print in the debug log. So I'm assuming I did something wrong. Thanks in advance!
Your answer
Follow this Question
Related Questions
add force get stronger over time slow. 2 Answers
How to destory gameObject without destroying the audio source attached to it? 2 Answers
How to make a controller for Rigidbody Spherical player which uses gravity?? 1 Answer
calculate the estimated distance travel based on the Force applied to Rigid Body 1 Answer
How to create a rolling sound that only plays when object is moving? 2 Answers