Ok so I’m attempting to teach myself this as I go but its so complicating!! I’ve been trying to fix up this script by watching tutorials, forums, the unity manual, and nothing is helping!
I can’t seem to understand what the problem is, so I hope someone helps me out and doesn’t decide to freeze this question too, as I’ve been searching for days now. I don’t want an animation to play or anything. I just have a box collider set up in front of the door and I plan on having a line that pops up as you enter, saying “press ‘button’ to enter”. Then I’ll have a load screen and so on and so forth. But my main goal is to just proceed to the next scene, which would be the inside of the house. I get this error every time I try to use the script:
Assets/scripts/Scene_Prctice.cs(9,30): error CS0120: An object reference is required to access non-static member UnityEngine.Collision.gameObject'
using UnityEngine;
using System.Collections;
public class Scene_Prctice : MonoBehaviour
{
public void OnTriggerEnter (Collision collision)
{
if(Collision.gameObject.CompareTag == ("Player"))
{
Application.LoadLevel ("noWhere");
}
}
}