I have a sphere which is moving forward by transform.translate.I want my sphere to stop moving when it is colliding with another gameobject e.g A wall.I've tried many things but can't figure out the proper way.Can anyone help me with it?Thanks in advance...
0
votes
What did you try? Where is your code? I mean, the current code that doesn't work. You have to put something to get something
- Programmer
void onCollision (Collision Collision) { GetComponent<Rigidbody> ().isKinematic = true; GetComponent<Rigidbody> ().velocity = Vector3.zero; } Thats what I've tried.Now as I put something,if you please give me somthing.
- solo365
as i said in third answer it's OnCollisionEnter not onCollision.
- N Fard
2 Answers
1
votes