I’m new here so apologies if this is not the correct place or process… I tried.
I’m trying to convert an old controller to the new input system and I am just not getting it.
I am trying to read the value from a new 1d axis similar to the old “Horizontal” axis from the old input manager. I am able to read the axis value as a float which appears to be returning the type of value used in my old controller but won’t execute and no compiler errors.
Thanks!
public class TouchController : MonoBehaviour
{
Rigidbody playershipRB;
float verticalMove;
float speedMult = 1;
public Vector3 playerPosition;
private CharacterController controller;
private float playerSpeed = 5.0f;
private Actions playerInput;
private void Awake()
{
playerInput = new Actions();
controller = GetComponent<CharacterController>();
}
private void OnEnable()
{
playerInput.Enable();
}
private void OnDisable()
{
playerInput.Disable();
}
void Start()
{
}
void Update()
{
playerPosition = transform.position;
verticalMove = playerInput.Player.VerticalMove.ReadValue<float>();
void FixedUpdate()
{
playershipRB.AddForce(playershipRB.transform.TransformDirection(Vector3.forward) * verticalMove * speedMult, ForceMode.VelocityChange);
Debug.Log("move");
}
}