loading...
Cover image for Adding Player Movement & Controls in Unity3D

Adding Player Movement & Controls in Unity3D

rcarlson profile image Robert Carlson Updated on ・3 min read

Alt Text

So I have a confession to make... I use 3rd-party assets to build games... a lot of them in fact...

In talking to other devs I often get criticized for my choice on using a ton of 3rd party assets. Critics tend of focus on the long term impact these tools may have on the game, emphasizing that a tool can sometimes be a limiting factor in your game design. This is a valid concern and one you should strongly consider!

For me personally though I simply don't have enough time to build everything from scratch. As a husband and father I'm not afforded long stretches of development time. Because of this I try to leverage tools others have built so I can focus more on game play and story.

With that in mind I wanted to share a tool I use often when making 3d games, it's called Invector https://www.invector.xyz! Please know this is not an advertisement or a plug. I'm not getting paid to write this. I truly believe in this tool and want to share it with you all :)

What is Invector?

Invector is a 3D character movement controller. It essentially handles all the user input and movement aspects of your player. Invector offers several different varieties of controllers such as a FPS (first person shooter) controller or a melle controller for action RPGs. In this example however I will be using the free movement controller. This one gives basic movement actions (run, walk, jump crouch).

Locating the Asset

First things first, you need to download and import the free asset from the Unity Asset Store.

Simply searching for "Invector Third Person Controller" should do the trick.

Alt Text

Once you've downloaded it, make sure to import it into your Unity3d project.

Creating the Movement Controller

Now that you have the asset imported, you should have a new navigation item on the top of your Unity editor. Click the [Invector] nav item and select [Basic Locomotion] -> [Create Basic Controller]

Alt Text

This will open a window for you to select your controller and model. Since you are using the free version you will only be able to select the Invector@BasicLocomotation controller. You can however import any model you have. I will be using the default model that comes with the asset. After selecting your model you will click [Create].

Alt Text

Trying it out

If you've done everything correct you should have a new player model and controller added to your scene.

Alt Text

At this point you can simply run your game and move your player around. You can move using WSAD and jump using [spacebar].

Alt Text

Now its simply a matter of tweaking the movement controller. To view your options select the [vBasicController_VBOT_LOD] object in your Hierarchy. The Inspector should have a section titled "Basic Controller LITE by Invector". Here you can make modifications to the movement controller. You will also see a section titled "Input Manager". This is where you can change the keybindings for movement.

Alt Text
Alt Text

And there you have it! Basic player movement in your game in about 5 minutes :) If you would like to learn more about this tool I would suggest checking out their docs!

Posted on by:

rcarlson profile

Robert Carlson

@rcarlson

Husband, Father, Coder, Gamer, Co-Founder LetsBuild.gg

Discussion

markdown guide
 

This is a great write up, thanks! I think there's always a need to be able to buy assets. People who claim that you have to build everything yourself don't understand that software is where it's at today because we CAN take advantage of abstractions or solutions other people have made.

Have you swapped this character controller mesh out with a custom character before? Is that fairly challenging to do?

 

As long as you have a Humanoid FBX Rigged model you can easily select that instead of the generic one I showed in the example. The standardization of the humanoid rigging makes the transition seamless.