Object reference not set to instance of an object?
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
transform.Rotate (0, 0, Event.current.delta.x);
}
}
"NullReferenceException: Object reference not set to an instance of an object NewBehaviourScript.Update () (at Assets/NewBehaviourScript.cs:17)"
This error gets printed 4 times once i save get back to unity.
I'm trying to get the gameObject this script is attached to to rotate as i move the mouse right or left.
Your answer
Follow this Question
Related Questions
Can't get a gameObject to follow my mouse 0 Answers
Depending on the mouse movement (or position), the player sprite 0 Answers
Unassigned Reference Exception although it is assigned 0 Answers
How do I create a drag system for a 2d Ragdoll 0 Answers
What does this error message mean and how do I fix it? 1 Answer