✅ Get the FULL course here at 80% OFF!! 🌍 https://unitycodemonkey.com/courseultimateoverview.php
👍 Learn how to make BETTER games FASTER by using all the Unity Tools and Features at your disposal!
👇
🌍 Get my Complete Courses! ✅ https://unitycodemonkey.com/courses
👍 Learn to make awesome games step-by-step from start to finish.
🎮 Get my Steam Games https://unitycodemonkey.com/gamebundle
💬 Let’s learn how to use the new Input System Package.
This is much better than the legacy Input Manager, it makes you write much cleaner code and makes it easily support any input type so your games are automatically playable with Keyboard and Mouse or Touch or Xbox/Playstation/Switch gamepad!
✅ Get the FULL course here at 80% OFF!! 🌍 https://unitycodemonkey.com/courseultimateoverview.php
👍 Learn how to make BETTER games FASTER by using all the Unity Tools and Features at your disposal!
00:00 How to use the Input System Package
00:34 Ultimate Unity Overview Course
01:41 Installation
02:00 Legacy Input Manager Vs New Input System
02:46 Create New Input Action Asset
05:00 Action Bindings
06:35 Player Input Component
09:24 Input System Phases
11:16 Invoke C# Events
13:12 Interactions
14:55 Processors
15:36 Generate C# Class
18:40 Movement Action (Value)
23:05 Reading Input Action on Update
24:28 Multiple Input Types, Keyboard, Gamepad (Control Schemes)
28:24 Stick Deadzone Processor
30:50 Pass Through, Disambiguation
32:10 Default Create Input Actions
32:50 Compact Input Test
34:00 Change Action Map
37:05 Input Debugger
38:10 Button Remapping
42:48 Touch controls
44:45 How to use the Input System Package
If you have any questions post them in the comments and I’ll do my best to answer them.
🔔 Subscribe for more Unity Tutorials https://www.youtube.com/channel/UCFK6NCbuCIVzA6Yj1G_ZqCg?sub_confirmation=1
See you next time!
📍 Support on Patreon https://www.patreon.com/unitycodemonkey
🎮 Grab the Game Bundle at https://unitycodemonkey.com/gameBundle.php
📝 Get the Code Monkey Utilities at https://unitycodemonkey.com/utils.php
#unitytutorial #unity #gamedev #unity3d #unity2d #indiegame #gamedevelopment #madewithunity #indiedev
Hello and Welcome!
I’m your Code Monkey and here you will learn everything about Game Development in Unity using C#.
I’ve been developing games for several years with 8 published games on Steam and now I’m sharing my knowledge to help you on your own game development journey.
I do Unity Tutorials on just about every topic, Unity Tutorials for Beginners and Unity Tutorials for Advanced users.
You can see my games at www.endlessloopstudios.com
- Other great Unity channels:
Unity – https://www.youtube.com/user/Unity3D
Brackeys – https://www.youtube.com/user/Brackeys
Dani – https://www.youtube.com/channel/UCIabPXjvT5BVTxRDPCBBOOQ
Jabrils – https://www.youtube.com/channel/UCQALLeQPoZdZC4JNUboVEUg
BlackthornProd – https://www.youtube.com/channel/UC9Z1XWw1kmnvOOFsj6Bzy2g
Sykoo – https://www.youtube.com/user/SykooTV
Jason Weimann – https://www.youtube.com/channel/UCX_b3NNQN5bzExm-22-NVVg
💬 Here's the much requested Input System video! It's a long video but it will teach your everything you need to know!
✅ Get the FULL course here at 80% OFF!! 🌍 https://unitycodemonkey.com/courseultimateoverview.php
👍 Learn how to make BETTER games FASTER by using all the Unity Tools and Features at your disposal!
These are the slowest tutorials I follow but you move too quickly. I have to pause every few seconds to see what you did. The information is great but I can't keep up with you at all.
My jump works with transform but not with rigidbody, i have this code –
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerControllerManager2D : MonoBehaviour
{
//Making Genrated c# class varieble
private PlayerAction playerAction;
private Rigidbody2D rb2D;
private Vector2 playerVector2;
private const float SPEED = 5f;
private void Awake()
{
rb2D = GetComponent<Rigidbody2D>();
//Making Genrated c# class object
playerAction = new PlayerAction();
//Enabling genrated c# class
playerAction.PlayerActions.Enable();
playerAction.PlayerActions.Jump.performed += Jump_performed;
}
private void Jump_performed(InputAction.CallbackContext context)
{
Debug.Log(context);
transform.Translate(Vector3.up * 5f); //HERE IS THE PROBLEM
}
private void Update()
{
Movement();
}
private void Movement()
{
//Getting player vector2 through genrated c# class
playerVector2 = playerAction.PlayerActions.Movement.ReadValue<Vector2>();
rb2D.velocity = playerVector2 * SPEED;
}
}
this works with transform but if i do it with rigidbody.add force the jump does not work and i have rigidboy on player why?
You are a life saver and I will check out your tutorials on youtube and courses. I was using the old input system which was doing the job just fine, but I also want to implement gamepad without all the extras and the new input system makes that so much easier.
Question, how do you show definition of the code in your visual studio code? which extension is it?
Wow 🤩
24:28 how does the Movement action work without definig the context phase? Is it calculating all 3 phases? And also are we not supposed to ReadValue out of context ? How is this working without context?
The most detailed tutorial I've seen about the new input system. Very good job 🙂
make sure everything is in the same folder or you will be able to use.performed and other stuff. Hopefully this helps you not waste 1.5 hours like me
ps2 cant detect
and one more doubt: about jumping, in an actual project we use the input manager separated from the moment logic, how can i make it the to the jump?
hey Code Monkey, i`m having on issue: my VScode isn`t showing the methods and other this from a class when i do something like: InputAction. or an Player. neither showing the option to access the class file.
Is it worth generating the c# class for PlayerInputActions if the game will be for couple of local players? Seems to create a mess with the usage of PlayerInputManager
I like the new system. There's much less clutter in your own code and the delegate-based system feels more slick than the endless slew of if statements you were previously stuck with.
That, and it's more configurable for the player and MUCH easier to change the controls based on context, e.g. walking or driving.
u kinda sound like kermit the frog
if we going to use in update method why we use new input events?
Just recently started getting back into Game Development and this guide was brilliant. It didn't just show the 'one true' way, but instead provided options and actually lets you make a decision for which solution is best for your project.
Does it work with visual scripting?
Could you make a video how to use the new input system for detecting touch gestures as pinch or two finger scrolling, pls.
Dear,
Thank for an amazing tutorial, it make me feel better with Unity.
I'm learning Unity for Archviz on Browser, how can i set my project can change input setting depend on device such as: Latop and Smartphone (with touch). Can you help me :(.
Hello CodeMonkey! How would I assign a button using the new input system if the execution of it is nested in a method. For example I followed your detect objects tutorial a while back and I have
private void HandleInterfaceRaycast()
{
Ray ray = playerCamera.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0));
bool hasHit = Physics.Raycast(ray, out RaycastHit hit, detectionDistance, interactableLayer);
if (hasHit && !TextBoxController.Instance.ShowingText)
{
bool hitInteractiveObject = hit.collider.TryGetComponent(out IInteractive interactable);
if (hitInteractiveObject)
{
if (Input.GetKeyDown(pressToInteractKey))
{
interactable.Interact();
}
}
}
for instance, now with the legacy version I could just write if (Input.GetKeyDown(pressToInteractKey)), but now I'm trying to subscribe with my playercontroller instantiated C# script and use a button to fire what's inside if (hitInteractiveObject) with playerControls.FPS.Interact.performed += /// but I don't know where to go from there.. Or am I doing it all wrong?