Hi, I'm relatively new to Unity.
I've made a script that when I tap and hold on the screen, the player moves forward, and when I swipe left and right, the player follows it. But the code is getting an error:
"NullReferenceException: Object reference not set to an instance of an object
PlayerMovement.Update () (at Assets/Scripts/PlayerMovement.cs:17)"
The script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement:...
NullReferenceException: Object reference not set to an instance of an object
I've made a script that when I tap and hold on the screen, the player moves forward, and when I swipe left and right, the player follows it. But the code is getting an error:
"NullReferenceException: Object reference not set to an instance of an object
PlayerMovement.Update () (at Assets/Scripts/PlayerMovement.cs:17)"
The script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement:...
NullReferenceException: Object reference not set to an instance of an object