Reputation: 65
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...
Upvotes: 0
Views: 107
Reputation: 75
Does your sphere has a collider?
you should put more information in your question next time, like the code so we could help you out even more
Upvotes: 0
Reputation: 1099
Use OnCollisionEnter.Put in a script that is attached to your object.
Notes: Objects should have colliders and Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached.
Upvotes: 1