Assets\PlayerManager.cs(11,37): error CS0246: The type or namespace name ‘Inputmanagar’ could not be found (are you missing a using directive or an assembly reference?)
Assets\PlayerManager.cs(17,22): error CS1061: ‘InputManagar’ does not contain a definition for ‘HandleAllInputs’ and no accessible extension method ‘HandleAllInputs’ accepting a first argument of type ‘InputManagar’ could be found (are you missing a using directive or an assembly reference?)
Assets\playerlocomotion.cs(32,61): error CS1061: ‘InputManagar’ does not contain a definition for ‘verticalInput’ and no accessible extension method ‘verticalInput’ accepting a first argument of type ‘InputManagar’ could be found (are you missing a using directive or an assembly reference?)
Assets\playerlocomotion.cs(33,75): error CS1061: ‘InputManagar’ does not contain a definition for ‘horizontalInput’ and no accessible extension method ‘horizontalInput’ accepting a first argument of type ‘InputManagar’ could be found (are you missing a using directive or an assembly reference?)
Assets\playerlocomotion.cs(46,63): error CS1061: ‘InputManagar’ does not contain a definition for ‘verticalInput’ and no accessible extension method ‘verticalInput’ accepting a first argument of type ‘InputManagar’ could be found (are you missing a using directive or an assembly reference?)
Assets\playerlocomotion.cs(47,79): error CS1061: ‘InputManagar’ does not contain a definition for ‘horizontalInput’ and no accessible extension method ‘horizontalInput’ accepting a first argument of type ‘InputManagar’ could be found (are you missing a using directive or an assembly reference?)
this is my player locomotion code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerLocomotion : MonoBehaviour
{
InputManagar inputManagar;
Vector3 moveDirection;
Transform cameraObject;
Rigidbody playerRigidbody;
public float movementSpeed = 7;
public float rotationSpeed = 15;
private void Awake()
{
inputManagar = GetComponent<InputManagar>();
playerRigidbody = GetComponent<Rigidbody>();
cameraObject = Camera.main.transform;
}
public void HandleAllMovement()
{
HandleMovement();
HandleRotation();
}
private void HandleMovement()
{
moveDirection = cameraObject.forward * inputManagar.verticalInput;
moveDirection = moveDirection + cameraObject.right * inputManagar.horizontalInput;
moveDirection.Normalize();
moveDirection.y = 0;
moveDirection = moveDirection * movementSpeed;
Vector3 movementVelocity = moveDirection;
playerRigidbody.velocity = movementVelocity;
}
private void HandleRotation()
{
Vector3 targetDirection = Vector3.zero;
targetDirection = cameraObject.forward * inputManagar.verticalInput;
targetDirection = targetDirection + cameraObject.right * inputManagar.horizontalInput;
targetDirection.Normalize();
targetDirection.y = 0;
Quaternion targetRotation = Quaternion.LookRotation(targetDirection);
Quaternion playerRotation = Quaternion.Slerp(transform.rotation, targetRotation, rotationSpeed * Time.deltaTime);
transform.rotation = playerRotation;
}
}
and this is my input managar code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class InputManagar : MonoBehaviour
{
PlayerControls playerControls;
public Vector2 movementInput;
public float verticalInput;
public float horizontalInput;
private void OnEnable()
{
if (playerControls == null)
{
playerControls = new PlayerControls();
playerControls.PlayerMovement.Movement.performed += i => movementInput = i.ReadValue<Vector2>();
}
playerControls.Enable();
}
private void OnDisable()
{
playerControls.Disable();
}
public void HandleAllInputs()
{
HandleMovementInput();
//jump acction
}
private void HandleMovementInput()
{
verticalInput = movementInput.y;
horizontalInput = movementInput.x;
}
}
thanls