Input Manager Simplified

Events, actions, enable, disable, lots of stuff going on here. How can we simplify this a little and get to basics. Let’s start by creating a capsule and do a simple movement system. I’m going to create a player capsule and add simple controls the old way.

This allows me to move the player forward when holding down W. I am also going to allow both systems for testing purposes. This is in settings/player

Next, I’m going to add a player input component to my capsule.

Afterwards, I’m going to create my own input action system. I’ll start with player movement and then add an attack. Be sure to save the input.

Drop in the player gameobject into the movement object and choose the direction function.

We can connect with those through events now. In the script, get your input library.

Now let’s create the functions that your event system will access. We will take the basic structure of the prior movement. We create parameter to pass through (vector 2) to a horizontal and vertical private variable.

We will then run a movement script with a transform.translate

Now we can move our object through our scene.

--

--

--

Unity Developer and Software Engineer who loves making games with GameDevHQ

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

My First summer software engineering internship interview in google

How to become a Django Developer in 3 days!!!

[LeetCode]RomanToInteger

Deploy ASP.NET Core 2 Web API to Azure with Docker

Top 5 Technical Interview Tips

CS373 Spring 2021: Siddhi Bhave

User Defined Functions in Pyspark…!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Al Heck

Al Heck

Unity Developer and Software Engineer who loves making games with GameDevHQ

More from Medium

What can you do to increase your credit score in Indianapolis, IN?

leetcode 1481. Least Number of Unique Integers after K Removals

Finding the Duplicate Number using Floyd’s Tortoise and Hare Algorithm

How to repair broken store window panes?