I'm having an error on line 19 Character 16, I am getting a CS0246 error, this code is taken from a public character controller so I'm not sure what's happening. The error also shows up on line 14 character 52 for IPlayerController.
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using TarodevController;
namespace TarodevController
{
/// <summary>
/// Hey!
/// Tarodev here. I built this controller as there was a severe lack of quality & free 2D controllers out there.
/// Right now it only contains movement and jumping, but it should be pretty easy to expand... I may even do it myself
/// </summary>
public class PlayerController : MonoBehaviour, IPlayerController
{
// Public for external hooks
public Vector3 Velocity { get; private set; }
public FrameInput Input { get; private set; }
public bool JumpingThisFrame { get; private set; }
public bool LandingThisFrame { get; private set; } = false;
public Vector3 RawMovement { get; private set; }
public bool Grounded => Cooldown;
private Vector3 _lastPosition;
private float _currentHorizontalSpeed, _currentVerticalSpeed;
}
}
Thank You if you know what's happening, the code is referenced again in the input section, for timing the jump.
private void GatherInput()
{
Input = new FrameInput
{
JumpDown = UnityEngine.Input.GetButtonDown("Jump"),
JumpUp = UnityEngine.Input.GetButtonUp("Jump"),
X = UnityEngine.Input.GetAxisRaw("Horizontal")
};
if (Input.JumpDown)
{
_lastJumpPressed = Time.time;
}
}
Here's the full code if it helps, https://github.com/Matthew-J-Spencer/Ultimate-2D-Controller/blob/main/Scripts/PlayerController.cs
Edit, Here is the error message:
PlayerController.cs(19,16): error CS0246: The type or namespace name 'FrameInput' could not be found (are you missing a using directive or an assembly reference?)