
It looks like you're new here. If you want to get involved, click one of these buttons!
my code doesn't work when i write this code;-
public class obstaclesp : MonoBehaviour
{ public playermovement movement;
void OnCollisionEnter ( Collision collisioninfo)
{
if (collisioninfo.collider.tag == "Obstacle")
{
movement.enabled = false;
}
}
Answers
Is movement script not disabling, if so, are there any errors in the console?
no error in console..
Screenshots of code in your editor, if possible
bro thanks for your concern but my issue was already solved. Actually, I was new in unity and thought that player movement is a function in unity. But now I got known that I was wrong.
Ok great. You will face many errors in beginning.