These are the errors I am getting:
1.Assets\scripts\PlayerCollision.cs(4,14): error CS0101: The namespace '' already contains a definition for 'PlayerCollision'
2.Assets\scripts\PlayerCollision.cs(9,10): error CS0111: Type 'PlayerCollision' already defines a member called 'OnCollisionEnter' with the same parameter types
and here is the code that the errors are most probably referring to:
using UnityEngine;
public class PlayerCollision : MonoBehaviour
{
public PlayerMovement movement;
void OnCollisionEnter(Collision collisionInfo)
{
if (collisionInfo.collider.tag == "obstacle")
{
movement.enabled = false;
FindObjectOfType().EndGame();
}
}
}
↧