NEW INPUT System in Unity - Mobile Input Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] new input system in unity follow these steps in the previous video we have configure the camera movement and now it's time for something different it's time to import the new input system why this input system is easier to use you can customize the functions like you did in the old input system but this input system is way more practical go to package manager Unity registry search input [Music] system confirm yes wait until Unity downloads and installs the package now it's time to implement [Music] it first create a [Music] folder then create input actions name it input [Music] system generate C class this will enable you import the entire input system in your project this is the input actions window add a new action name it movement right click and first set to Value any any type of value right click add positive negative binding in the previous versions this was considered a 2d binding but this is changed name the action arrow keys for the negative go to PF listen press the left Arrow key now press the right arrow key for positive and add another positive negative Action For A and D Keys like wsd movement in most video games negative a positive [Music] d add jump action listen space it's only one action inside you don't need positive negative binding like you did it [Music] before you configured the input system now it's time to [Music] import input system cont controls this is the reference to the new input system which is how I called input system void aake it loads before void start controls new input system this introduces the input system in the project controls enable as it says this word enables the input system controls land movement performed plus equals some very weird syntax CTX Direction CTX read value float that's because we have set it to float controls land jump performed plus equals CTX oh I can't pronounce it very well now make sure that you have jump action because we defined it void [Music] jump if is grounded is grounded which is defined like here bull is grounded RB velocity new Vector 2 or intellisense this is how it knows what should I type RB velocity X jump speed thank you intelligence this is very important enable the input system with void on enable because this line of code enables the script and we need a line of code that disables it save the script and go back to Unity before testing the new input system I will first add the buttons add the canvas oh this is so large add the UI buttons all canvas elements are very large compared to the main camera and entire unit is scen import TMF Essentials Essentials make the movement buttons simply by adding UI buttons text mesh Pro type left or the symbol that I typed which is the last sign and negative sign then copy the button and type right or the symbol that I will type right [Music] now make sure to set the correct alignment to the buttons add on screen button component listen press right arrow key now add the jump button type jump [Music] go to on screen button listen [Music] space there's a very little bug and only the jump button is working let me show you how to fix [Music] it go to input system interactions press add press and release action do it for both movement and jump actions press press and [Music] release if the onc screen buttons are still not working this is a quick fix and make sure that the press and release behavior is set go to movement script of the player and set movement speed to 300 or a very big number to make it work this will look better on mobile phones I will make more tutorials whenever I available have a good [Music] day [Music]
Info
Channel: Kozmobot Games
Views: 6,268
Rating: undefined out of 5
Keywords: unity tutorials, game dev tutorials, game development, game development tutorials, mobile input unity, new input system unity, movement player unity, mobile input tutorial unity, new input system in unity, 2d platformer, 2d platformer unity, 2d platformer tutorial, 2d platformer in unity, 2d platformer new input system, 2d platformer unity tutorial, mobile input in unity, new input system tutorial, new input system unity tutorial
Id: 6yC2lNaPUM0
Channel Id: undefined
Length: 7min 44sec (464 seconds)
Published: Mon Oct 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.