I've been using a tutorial guide for the game I'm making to figure out the basics and I ran into 2 errors while coding the collisions:
- Invalid token "{" in class, struct, or interface member of declaration and
- Type or namespace definition, or end of file expected.
Here is the code:
using UnityEngine;
public class PlayerCollision : MonoBehaviour
{
public PlayerMovement movement;
{
void OnCollisionEnter (Collision collisonInfo)
{
if (collisonInfo.collider.tag == "Obstacles")
movement.enabled = false;
}
}
}