using UnityEngine;
public class PlayerCollision : MonoBehaviour {
public PlayerMovement movement;
void OnCollisionEnter (Collision collisionInfo);
{
if (collisionInfo.collider.tag == “obstacole”)
{
movement.enabled = false;
FindObjectOfType().EndGame()
}
}
}
it shows me this error
Assets\Scripts\PlayerCollision.cs(8,5): error CS1519: Invalid token ‘{’ in class, struct, or interface member declaration
using UnityEngine;
public class PlayerCollision : MonoBehaviour
{
public PlayerMovement movement;
void OnCollisionEnter(Collision collision)
{
if (collision.collider.tag == "obstacole")
{
movement.enabled = false;
FindObjectOfType<GameManager>().EndGame();
}
}
}
The problem is the semicolon at the end of your function declaration OnCollisionEnter.
I would suggest to spend some time looking at the c# basics, there are plenty of tutorials. Spend a while practicing and you will master it in no time 