Objective: make quick prototypes with the new input system

in the old input system, its quite fast to try something out, and there is a way to do that with the new input system aswell.

In the past we would use input.GetKeyDown(KeyCode.`$key`)

Now we can still get similar input information from Keybord.curret.`$key`.wasPressedThisFrame

--

--

objective: create different jumps depending on the pressed time

In some games the players jump higher if the button is pressed longer, and we can do this in the input system aswell.

In the action map, you can add multiple interactions in to same action

--

--

Objective: Switching Action Map

Previously we have different Game Objects running different Action Map. But what if we want the same Game Object switching bettween Action Maps?

Since we previously proved that multiple action map can work at the same time. To be able to switch between controlls, we need to disable the current one, and enable the others so the input is not conflicted/combined. One way is that we can add another script to control the switching.

The first two script will remain similar to what it was from the last article. Except making a public method to enable and disable the action maps.

Control1:

Control2:

--

--

Objective: Multiple Action Map

Since we are creating new instance of the playere control on each script, we can actually have different script running different action map at the same time. As long as the action map is enabled.

So if we have the first movement set as

--

--

Objective: Use Unity new input system to move

To move around in the game we need the vector 2 from our key input. we can try the same method get it from perfom.

but perform only trigger when ever i pressed, so it will only move whenever i hit the key

--

--

Objective: Set up for Unity new input system

once the input C# script is generated, we can access it. before using the inputs in a script, we need to:

  1. reference it in the script
  2. enable the input map
  3. Register the perfom function

and add the method that we are adding to when performing jump

--

--

Objective: Make Customized Curser

Often times, we want to have customized curser for our game.

In File> Build Setting, open Project Settings under Player, there is an option to set default curser.

An alternitive way is to use an ui image

--

--

Sidchou

Sidchou

11 Followers

An Unity Developer who loves to create interactive and immersive experiences.