I have been coding with C# and have run into some issues. I have been following this YouTube tutorial and I have some errors. On line seven in Walking state code it says:
Error CS0507 'WalkingState.ProcessMotion(Vector3)': cannot change access modifiers when overriding 'public' inherited member 'BaseState.ProcessMotion(Vector3)'
What does this mean and how can I fix this?
Base state code:
using UnityEngine;
using System.Collections;
public abstract class BaseState : MonoBehaviour
{
protected BaseMotor motor;
#region baseState implementation
public virtual void Construct()
{
motor = GetComponent<BaseMotor>();
}
public virtual void Destruct ()
{
Destroy(this);
}
public virtual void Transition ()
{
}
#endregion
public abstract Vector3 ProcessMotion(Vector3 input);
public virtual Quaternion ProcessRotation(Vector3 input)
{
return transform.rotation;
}
}
Walking state code:
using UnityEngine;
using System.Collections;
public class WalkingState : BaseState
{
protected override Vector3 ProcessMotion(Vector3 input)
{
return input * motor.Speed;
}
}