I follow the tutorial from samyam in Youtube
CS1061 ‘PlayerMovement’ does not contain a definition for ‘Main’ and no accessible extension method ‘Main’ accepting a first argument of type ‘PlayerMovement’ could be found (are you missing a using directive or an assembly reference?)
I get this error as well as I try to use Enable and Disable on OnEnable
Also, I saw the comment in yt about this problem and I see his comment said that Make sure you named it exactly Main with capital letters, also try regenerating the script. What is this mean?
Here is my script (not finish yet)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController02 : MonoBehaviour
{
private PlayerMovement controls;
private void Awake()
{
controls = new PlayerMovement();
}
private void OnEnable()
{
controls.enabled = true;
}
private void OnDisble()
{
controls.enabled = false;
}
private void Start()
{
controls.Main. //<<<This is my problem here
}