I can't figure out what the heck is wrong with this, the error is
NullReferenceException: Object reference not set to an instance of an object movment2D.FixedUpdate () (at Assets/movment2D.cs:21)
my code is
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class movment2D: MonoBehaviour
{
public CharacterController2D controller;
public float runSpeed = 40f;
float horizontalMove = 0f;
// Update is called once per frame
void Update ()
{
horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
}
void FixedUpdate ()
{
controller.Move(horizontalMove * Time.fixedDeltaTime, false, false); <-- here
}
}
it says the two false tags are the problem but idk why