Legacy → New Input System: Interactable

Eric Veciana
2 min readJan 14, 2024

--

This is a short and sweet article explaining how I converted an older script using the old input system for interactables into the new input system.

First, I created a new Action Map and added two bindings. One to interact with the interactables and the other to escape.

I initially thought I needed to create an Interaction for Press and Release since my Hacking interaction requires you to hold the key down, but I noticed that if I am using the Button binding I don’t need to do that. I can do this by simply using the started and canceled functions within my script.

I am using the performed function for my basic interactions such as a simple press of a button to perform the action. Then, I used the started method to place the function for starting the hacking system, and if we let go of the key, it will call the canceled method.

Here is the hacking system below. You can see that when I release the key the charge bar disappears.

Finally, within my Drone script. There is a legacy input for the escape key to exit the camera as well as the drone. So, I’ve added that within the drone script as well using the performed function.

And that's it for the interactables! This one is easy. Stay tuned to learn how I changed the inputs for the drone!

--

--

Eric Veciana

As a Unity and C# developer with a background in nursing, I'm a creative problem-solver with a passion for creating games and other interactive experiences.