Unity 2020 - New Input System - Move and Rotate Object with Gamepad

preview_player
Показать описание
In preparation for adding player movement to the remaking Minecraft series, we are doing a tutorial on player movement using the new Unity input system.
Рекомендации по теме
Комментарии
Автор

transform.Translate most certainly does work with collisions. You have to mark 'is kinematic' as false for collisions to work. It is also highly recommended that you avoid using GetComponent in any update function. You're asking it to search for a script a lot every second, which doesn't scale well. You want that to be isolated for specific conditions or when something is run a few times.

rib_rob_personal
Автор

I'm glad I am not the only one who thinks this input system is unnecessarily complicated to set up and implement.

deadwreck
Автор

Best tutorial about the input system. My brain was starting to smoke after watching alot of them. looking at the documentation from unity confused me even more. Thank you alot. Great teacher skills btw.

StonedTrainRide
Автор

6:33 this is the code snippet I was looking for, ty! Don't know why it's so hidden

xX_dash_Xx
Автор

Anyone who arrives here should take note that "getcomponent" probably shouldnt be used in the update because its finding the component every frame. Maybe store it in a var in the start or awake function. Also I dont think lines 16-20 are needed. Also dont use get component on transform. Just do transform.rotate, it will target the current object's transform.

Totally not trying to rag on your code. I always forget how to rotate an object properly and everyone acts like its magic or something. Thanks!

KillerGameDev
Автор

You 100% earn a sub. I have been trying to find a good and recent tutorial with controls like these and it is perfect thank you so much!!

Huemar
Автор

thank you so much! You have been very helpful. Thank you very much for preparing the 2020 resource.

I looked at about 10 people but none of them worked. just you did. Thank you

Could you put the codes in the explanation section?

ilyaszan
Автор

Hey amazing video and you have earnt a sub! By any chance did you ever improve on the rotation and movement code to take into account the current rotation of the object?

danielparker
Автор

Thanks im making a playlist for when I'm done traveling

ElcoolMo
Автор

How about normal Touchscreen movements? Just moveing alongside every direction with a finger?

rebarius
Автор

Great video, I'm making a first person game and was wondering how I could clamp the rotation?

nathancct
Автор

Nice doge on the character controller component there! I'm looking for a tutorial that does both input action and the char controller but everyone avoids it because gravity and jump is difficult.

Ben-bglp
Автор

on "moveCube.cs", when i try to hit play on unity after doing the first part, it gives me a whole bucket-load of errors, and tells me i cant start the game. things like "Invalid token "=" in class, struct or interface member declaration", and "Tuple must contain at least 2 elements"
i followed everything letter by letter and im getting at least 20 errors

edit: did everything i can and still have 13 errors...

hyperguudo
Автор

Hey man, nice Tutorial. Does it work with a sphere? I want to control my Ball with a virtual joystick like the left analog stick. Maybe a next video idea..?

AlexSurf
Автор

what have u done at 9:04 when the 2nd cube appears? thx in advance.

erdbeerbus
Автор

tnks for this tutorial. the best tutorial for rb movement.

Автор

they fragmented cuz the old system was better for simple noobs (like myself) lol the new system is very intimidating.. at first along with all the other things you're trying to learn at the same time.

michaelwilliams
Автор

so im trying to make it so i can have 2 controllers control 2 different cubes but both controllers control both cubes and I just want them to control 1. can anybody help me? yes, I've used the input managers and set them up correctly, but it's not working

carterkramer
Автор

The reason the creators of this library chose to adopt this syntax is so you can assign as many actions as you like when the action is performed, and have them be context-sensitive. Obviously, you might not want to use this solution if your game's control logic is quite simple, but this interface is a very powerful and flexible choice for more advanced solutions.
Side note, | means "logical or" in C# (and many other languages). Using | to mean "pipe" is more typical of terminal scripting languages like Shell or Bash.

unknown-kjqp
Автор

Hello.

Unity tells me "Assets\Scripts\Mover.cs(27, 74): error CS0428: Cannot convert method group 'ReadValue' to non-delegate type 'Vector2'. Did you intend to invoke the method?" for this line += cntxt => rot = cntxt.ReadValue<Vector2>;

NinStationTV