How To Make A Player Controller With Unity 6, Physics & Visual Scripting With New Input System 2025

preview_player
Показать описание
==========
movePlayer?
==========

1) add rigidbody (constrain XYZ rotation so it doesn't fall)
2) add player input (so keyboard is detected)
3) add script machine and create new (use easy-to-read name)
4) add moveSpeed variable float (to set speed)
5) add node "on input system event vector 2" node, set [ Move ] as input action
• find this here: rightClick graph background, Add node: Events ► Input ► the ones with thunder icon
6) add a newVector3 node.
7) Get X and Y from axis output of the "On Input System"
8) Connect X to X and Y to Z of the vector3 node
9) Multiply vector3 output with a moveSpeed variable
10) Connect this multiplied result to AddForce force input

=========
playerJumping?
=========

1) add jumpForce variable float
2) add "on input system event button" node, set [ Jump ] as input action
3) add new vector3 node
4) connect speedForce to Y
4) connect vector3 output to AddForce
5) change AddForce mode to Impulse

----------
Notes:
----------

• Turn OFF "Human Naming", so you need nodes with similar names to C#. This helps you to learn C# and backward engineer C# scripts you find online.

► In Unity Editor, click Edit ► Preferences ► Visual Scripting --- It's there above "100" Max Search Results.

• Make sure you are using Input System (not the legacy).

► In Unity Editor, click Edit ► Project Settings ► Player --- go down, almost 3/4 near the end... above Script Compilation block. There's a "Active Input Handling". Set [ Input System Package (new) ]

O_O!

Don't want physics to make your player move more static?

Рекомендации по теме
join shbcf.ru