#Unity Fps new input system Cinemachine (HELP PLEASE)

1 messages · Page 1 of 1 (latest)

vestal sky
#

[RequireComponent(typeof(CharacterController))]
public class PlayerController : MonoBehaviour
{

    private InputManager inputManager;
    
    [SerializeField]
    private float playerSpeed = 2.0f;
    [SerializeField]
    private float jumpHeight = 1.0f;
    [SerializeField]
    private float gravityValue = -9.81f;

    private CharacterController controller;
    private Vector3 playerVelocity;
    private bool groundedPlayer;

    private void Start()
    {
        
        controller = GetComponent<CharacterController>();
        inputManager = InputManager.Instance;
    }

    void Update()
    {
        groundedPlayer = controller.isGrounded;
        if (groundedPlayer && playerVelocity.y < 0)
        {
            playerVelocity.y = 0f;
        }

        Vector2 movement  = inputManager.GetPlayerMovement();
        Vector3 move = new Vector3(movement.x, 0f, movement.y);

        controller.Move(move * Time.deltaTime * playerSpeed);

        if (move != Vector3.zero)
        {
            gameObject.transform.forward = move;
        }

        // Changes the height position of the player..
        if (inputManager.playerjumpedthisframe() && groundedPlayer)
        {
            playerVelocity.y += Mathf.Sqrt(jumpHeight * -3.0f * gravityValue);
        }

        playerVelocity.y += gravityValue * Time.deltaTime;
        controller.Move(playerVelocity * Time.deltaTime);
    }
}```
#

can anyone please help me
i am trying to fix this for like 30 mins now
here are tutorials i followed
:-https://www.youtube.com/watch?v=5n_hmqHdijM

:-https://www.youtube.com/watch?v=we4CGmkPQ6Q

Learn how to use Cinemachine and the new input system to make a First Person Controller in Unity!

ᐅGet the full Source Code Bundle to my Unity Tutorials 🤓
https://sam-yam.itch.io/samyam-full-source-code-to-all-videos

**DO THIS ► There is an easier way to override the old input system values in cinemachine using the Cinemachine Input Provider (...

▶ Play video

How to use the newest input system with Cinemachine using the Cinemachine Input Provider.

ᐅGet the full Source Code Bundle to my Unity Tutorials 🤓
https://sam-yam.itch.io/samyam-full-source-code-to-all-videos

Thank you for 2,000 subscribers!!!

🔗 Documentation Link 🔗
https://docs.unity3d.com/Packages/[email protected]/manual/Cinemachin...

▶ Play video
#

for context
yes i am using unity 2023 urp and have followed tutorial properly

#

or if there is any other way to make fps movment with cinemachine

please do let me know

grave flower
#

@vestal sky
Hi, it works with the old input system?

vestal sky
#

Would be appreciated if you could drop any tutorials

#

Thanks.

grave flower
vestal sky
vestal sky
#

Also fun fact:- the camera look works if I change the mouse delta to arrow keys or any different ways to use it

vestal sky
#

updated to cinemachine 3.01

#

kinda works now using tilp and pan insted of pov(there is no pov options now)

#

but only the cm cam rotates and the actul cam just stays put

#

like in image

#

my main camera has cm brain too