Making a basic game and i have an issue in my c# code

using UnityEngine;

public class playercollision : MonoBehaviour{


    public Playermovement movement;


    void OnCollisionEnter(Collision collisionInfo)
    {
        if (collisionInfo.collider.tag == "Obstacle")
        {
            movement.enabled = false;
            FindObjectOfType<GameManager>().EndGame;
        }


    }
}

the issue is at line 14

thanks

This very much is not the right place to post this. And you’ve given less than the bare minimum amount of information on what the actual problem is, or what you understand about it, or what you’ve tried to do to solve it. I would suggest going to the Answers section of this site and posting there (but please also include more detailed information when you do)

3 Likes

/\ This /\

However not the Answers, but Scripting.

“The issue is at line 14”

this needs to be a meme we can spam any future low-effort fails with.

@Thewizard123456 , you’re going to get as much help as you give. Problem solving is even more difficult to do remotely so you got to make it easy by providing all the details and spelling out the story of what you are doing. Oh, and post in the correct place, blah blah blah.

1 Like

Okay, but what’s the purpose of line 14? Were you trying to set a variable? Were you trying to call a function?