Це відео не доступне.
Перепрошуємо.
Controlling Cross-Platform Characters with Unity Input System | Tutorial
- Додати в
- Мій плейлист
- Переглянути пізніше
- Поділитися
Поділитися
Вставка
Розмір відео:
- Опубліковано 19 сер 2024
КОМЕНТАРІ • 175
Наступне
Автоматичне відтворення
Input System: Workflow tips and feature integrations | Unite Now 2020Unity
Переглядів 70 тис.
Making MULTIPLAYER Games has never been EASIER!Code Monkey
Переглядів 78 тис.
Character Movement in Unity 3D | New Input System + Root Motion ExplainediHeartGameDev
Переглядів 161 тис.
Get 10 Mega Boxes OR 60 Starr Drops!!Brawl Stars
Переглядів 15 млн
MELLSTROY - первое интервью: как живет самый обсуждаемый стример годаВПИСКА
Переглядів 14 млн
How I Did The SELF BENDING Spoon 😱🥄 #shortsWian
Переглядів 35 млн
КАПИТАНА С КУРСКОЙ ОБЛАСТИ, НЕ ПРИЗНАЮТ РОДИТЕЛИ. РОМА ИЛИ НЕ РОМА? @dmytrokarpenkoApostle Dmytro Karpenko
Переглядів 1,2 млн
Use Unity's Input System Like a ProParidot
Переглядів 27 тис.
Unity's "NEW" Input System with C# EventsOne Wheel Studio
Переглядів 88 тис.
How to build beautiful landscapes in Unity using Terrain Tools | TutorialUnity
Переглядів 228 тис.
Using Interfaces in Game Development (Unity Tutorial)Infallible Code
Переглядів 88 тис.
Easy Joystick for Mobile with Input System in Unitysamyam
Переглядів 142 тис.
Make your Characters Interactive! - Animation Rigging in UnityBrackeys
Переглядів 879 тис.
Installing The Sonic Drive-In Operating SystemBringus Studios
Переглядів 433 тис.
Collide And Slide - *Actually Decent* Character Collision From ScratchPoke Dev
Переглядів 86 тис.
KLAVDIA PETRIVNA, МАША КОНДРАТЕНКО - ЇДЕ ДАХ (OFFICIAL VIDEO)Klavdia Petrivna
Переглядів 930 тис.
Я тоже так могуDouble Bubble
Переглядів 2,4 млн
КАПИТАНА С КУРСКОЙ ОБЛАСТИ, НЕ ПРИЗНАЮТ РОДИТЕЛИ. РОМА ИЛИ НЕ РОМА? @dmytrokarpenkoApostle Dmytro Karpenko
Переглядів 1,2 млн
Курск и Суджа России НЕ НУЖНЫ? ПОЗОР Ахмата | Антизомби 2024 - 30 полный выпускТелеканал ICTV
Переглядів 765 тис.
«Путін почав це, надеріть йому зад»: американські сенатори про операцію ЗСУ в Курській областіРадіо Свобода Україна
Переглядів 691 тис.
Державний Прапор України підняли на КУРЩИНІ в рф😍🇺🇦💪🏻 #курськ #прапорукраїни #рф #війна #наступТелеканал Конкурент TV - новини Луцька та Волині
Переглядів 433 тис.
АЛАУДИНОВ у Скабеевой: эти их ВСУ нас НЕ ДОГОНЯТ 😁 [Пародия]Юрий ВЕЛИКИЙ
Переглядів 1000 тис.
Using the Input manager component with those callback methods was what I found the most approchable for beginners
Every new Unity Video I realize my Game is missing something 😂😂😂 Thanks!!
This is such a useful feature and shouldn't be so hidden away!
This entire thing is a new plug-in, that's meant the replace the current system. Calling it hidden isn't really a correct description; it's new(ish). Unity does have a free course on how to use this new Input System. The course is more detailed, but it sort of skipped the final details at the end where we actually use the values provided by this new Input System.
@@FranciscoTChavez I know that, but even on my school (game development) I am one of the only ones who even knows this is a thing.
Glad to see I use it properly!
Documentation can be a bit vague
One important note :
You need to set event functions IN the prefab and not in the prefabe instance of the scene.
Otherwise it won't function proporely.
Amazing tutorial I've been trying to make it work for so long and after watching this everything worked perfectly
We're glad this helped :)
@@unity please zoom in wherever possible while making videos so that we can see 👀 better & understand better 🧐🤔
2:17 It would've really helped if you'd explained that you need to first add "public PlayerInput playerInput;" *and* get the component in order to make this functionality work. I was so confused.
your new input system is a step in the right direction, but its way too convoluted and over engineered solution for the most fundamental feature of any game, specifically the cross binding and rebinding new keys in game between gamepad and keyboard. It would be awesome if you had more documentation / examples on this.
I agree that it is convoluted in the way that's shown in the video, but using C# events with delegates rather than Unity Events makes things much faster and easier. I would recommend checking Brackeys' tutorial for this.
@@emredesu Link? I could search but I don't know if your referring to a C# / delegate video, a Character controller video, an Input system video, or something else.
Thanks unity for providing your wisdom. I'm trying this for 2 days and now I got the trick to do this.. 😇🙏🏻
Thank you Unity for this useful input system
Touch controls doesn’t seem to be working/included in the project
Thanks. This makes it easier to understand the new input system, I usually use the old input manager
When is all this learning gonna end😫😴😂😂
Hang in there, at one stage, all start to connect and the stars start to align and we look at it as good knowledge to make game faster instead of burden of learning =)
Learning is the best part!
It ends when you have a large team of people, each focused on their own specialities. :P
NEVER
i’ve started learning in 2013, and still here I am
1. Can player remap the buttons?
2. How would you implement input button glyph visualization that updates when input method changes?
Public keywords they are a variable and can be changed upon input!
It might be just me but it feels more complicated than necessary. But still good job overall thank you
This was very helpful I am developing a test game and this will be a good start thanks unity
Awesome! Thanks for sharing :)
I've selected my playercontroller script, but I cannot set any method. Sad. This is the fourth tutorial that fails me.
Is the method public?
So, when the old Unity Input System will be deprecated?
2099
No reason to force other devs to use this if they already have working systems. It won't be deprecated for a long, long time.
Answer from Unity live session:
Kristyna Hougaard:
We don’t have an ETA for that yet. New systems such as UI Toolkit or DOTS will be fully supported by the Input System only and the old Input Manager, so it’s a bit of a gradual process.
Here is some code they used in the video
Public void OnMovement(InputAction.Callbackcontext value)
{
Vector2inputMovement = value.ReadValue();
rawInputMovement = new Vector3(inputMovement.x, 0, inputMovement.y);
}
This is amazing, thank you so much!
How would I go about making inputs touchscreen? Not on-screen buttons, but actually clicking some game-elements on screen acts as an input. (like fruit ninja for example). I don't understand how to switch to something like this on mobile while on PC it acts as a simple keyboard input instead.
You'd basically want to detect a swipe event and then act on the GameObjects within that swipe distance. Then you draw a trail or something so the player can see it, and then you make the fruit explode. :)
Just break it down in pieces if it gets overwhelming. Engineering is hard.
Thats so cool engine
I do not think so
@@user-fz4te6qd9b i can't argue with u because its your opinion
Thanks this helps a lot for me
@Unity What gets me is every video you watch from unity, in particular, they only show you how to use this new input system on a gameobject never from the UI perspective and then into a game scene where you control the player.
just add the Player Input component on your UI gameobject and select the approriate callbacks.
If that's what you were asking about
Great now I want to program this via script.
Ok, at 5:23 you open up the drop down to show the Events in the Player Input, what I missed was a few seconds later at 5:25 was when you clicked that second drop down to expose the Player Controls... this cost me hours of trying to figure out the other event boxes wouldn't accept my Input methods from my script and was super frustrating. Maybe you should put up an annotation or something?
omg this will help me much thanks unity
A way of assigning keyboard keys to ui objects would have been perfect for me...
I get how this fancier and more extensible but Christ is this confusing for beginners
Crazy. Nothing seems to work. Only the exact speciied scenario for every tutorial.
all these new technologies in Unity like this Input are nice but tbh their implementation is way different and difficult for a beginner.
It’s doubtful a true beginner will be trying to develop cross-platform, or offer fancy customizable controls within his first games. This is more of an intermediate feature, for which the complexity should be reasonable.
i fallowed the tutorial exactly the same, and yet, when i keep the button pressed down, the event was only called once, instead of continuously :D
The system itself is pretty cool, i really liked but lack of explanation for the those "edge cases" is HORRIBLE. Even the Documentation is not good to explain that
me paso lo mismo
Exactly!!!! I've just discovered this too, and now have to switch back to my old Input methods.
Well that's what GIT is for ^^
@@TheOfficalAndI there is a solution. Create a boolean variable to indicate if the input is being pressed, like: "isMoving"
If you need to get data abou the direction, create another global variable Vector2 do hold the direction.
Inside the event method use performed and cancelled to update both variables.
In the class that you will use the data from the input. Create a reference to the class containing the input method and the variables you create(which must be monobehaviour). Use the boolean value in the update loop to conditionally call the function that will perform the action, and the vector2 you created to indicate the dicretion.
It worked for me
It's not as good as if it worked continuosly by default, but still way more Modular.
What should be the approach if I want to change something about the display based on the current scheme? For example when I'm showing the player what button to press
I don't get anything in the Inspector when trying to hook up the events. Everything in my class is public but none of them are listed in the Inspector to be assigned.
A good step but it is soooo overcomplicated and overkill compared to what it's supposed to do
Still better than the paid ones, where you don't know what you get and doesn't work with next Unity version. And it's not that complicated, you just need to get used to using it.
Yay! :D thank u Unity!
It says "rawInputMovement does not exist in the current context"
How can I fix this?
The new input system caused my animations to stop running on a 2d game, you need more documentation on using this system with 2D games
Спасибо!
"Crossplatform"... Even though what is said in this tutorial is true, porting a game to xbox, switch and ps4 is quite a challenge and can take up to 6 months. Abstracting the inputs is just a tiny, almost negligeable part of the port.
My dream is that one day, Unity release a true "crossplatform" package that can handle the most tedious crossplatform tasks: storage with saveslots, user management with multiple controllers, generic and uniform messaging, achievements. That would make unity a great ENGINE by letting developpers focusing on the gameplay. It would also allow more games built with unity to be shiped on the market.
Finally!!!
finally what XD
one of the cool engine
I'm doing something wrong here. With WASD my player just jumps N, S, E or W a set amount per key press.
I'm still new to Unity...
> I like the more intuitive " Input Action Asset," but I have yet to understand and how to get it to work properly...
2:20 ---> I feel like there should be links to the screenshots because they go away instantly...
> I realized it's a video and it can be paused to view to code...
Does the new input system work with the UI Toolkit yet? I'm on 2021.2 (Alpha)
In 2022 it doesn't work out of the box unless I missed something, I am pretty sure I need an InputActionManager in the scene, it may also be that I need to enable the action map or the specific actions...
This won't work if you follow everything perfectly! The video does not show adding devices to a control scheme from the Input Actions Asset. Important step; won't work without it.
this engine has 8 pistons
More confusing and complicated than needed... Unity could do a LOT of things easier for devs
It basically front-loads all the complexity. Once you've got the system set up, it really shines -- using callbacks makes for some very modular code and it lets you do compile-time checks of your input management.
When will it be fixed for Unity 2020?
EDIT: It does work now
I stand corrected. It actually looks like it's working in 2020.1 now
@level90s nice, yea for a while it was broken in 2020+
You have to add this line to your script if you want to use the Input systeme
using UnityEngine.InputSystem;
Download the project and it does not have Mobile support. I tried to do it myself and every time I click the button for my player to jump ... Unity closes.
wow awesome
Ya, that’s bindings, it’s ok. Fine. What I should do for support touch and game pad? How switch on the fly between touch/game pad/keyboard ?
Rewatch more carefully the tutorial, lol
@@revengerwizard I’m think you don’t understand me
@@zitskycom The Input System supports also touch and game pad, you just haveto search it in the bindings. Also, to switch on fly you can use the method shown in the video. Or explain yourself.
YOu don't have to rebind them, because it detect what platform on you, and switch automatically.
@@klarnorbert ok, I’m explain. Imagine tic tac toe. I’m can touch or click to socket for placement mark.. but I can’t do that on game pad. Should do some focus system and highlight selected socket, right? So, how I’m can do it in unity out of the box?
Where is that Player Controller coming from at 5:08?
same issue any solutions?
Unity editor isn't recognising or listening to an xbox controller on my PC (it works for Steam games, so the controller is fine). How do I install or configure Unity to notice my controller?
What about split keyboard?
Just set up two keyboards with different inputs and assign the controls to each player and you'll have split keyboard gameplay
how do i make it work for android?
i followed the steps in the PDF for first person character and it wont work on my phone when i build to test it, the joystick does nothing... it registers the touch in the debug but it doesnt take the input no matter where i tap it recognizes the touch but no movement whatsoever..
I have downloaded the latest version of this project from github and I am trying to learn how it works. 1 issue that I can't solve is that the camera has 2 modes, stationary and follow and orbit. But I only want one where the camera follows the player from behind and above his shoulder and turns using the mouse. I don't want the extra spinning and zooming that occurs in the orbit one. How do I change this?
I am addicted to unity. Can't stop making games. Thanks unity corp for making an engine like this. This is the best and most overrated engine.
LoL same!
I’m still in the learning stage but I feel you. All I’ve done so far is make a basic version of “Jenga” but the satisfaction of making a thing work is incredible. I’m now working on making a simple player model and I’m excited for the future possibilities!
you meant underrated ;)
@@robosergTV no it's overrated bro
@@__Rizzler__ it seems you are using “overrated” wrong. That means “the thing is worth less than it’s made out to be,” which is the opposite of what you say at the beginning of your comment (unless you tried to be sarcastic). The right term would be “underrated”, as @Robko wrote.
I having a problem where it only does something when the input value is changed. I dont know how to run this consistently and even tried doing your code and still nothing. If you could tell me why this is happening, that would be great. Thank You
nvm
Could you guys make a proper unity 2D movement tutorial?
Hey there. Is something like this what you're after? learn.unity.com/tutorial/live-session-2d-platformer-character-controller# ? Let us know if not so we can ask around for you.
@@unity Hi, thanks for answering my comment I'm looking for a proper movement tutorial for unity 2D but I can't find a good tutorial in unity learning section. It seems you're just modifying already cretared game
and also in the tutorial videos you are just learning how to use one specif command but you never learn how to use this command for making something works. like using varibles and functions in the same video. But this link (tutorial) seems actually doing everything I wanted :p
why u dont show me the OnButtonScreen
its already used in the Chinese version of Unity.
I cannot reference my Function in the Unity event, any help?
using UnityEngine.InputSystem;
@@studioschmudio9916 I have this issue too however I am referencing UnityEngine.InputSystem... It just doesn't give me the option to choose OnMovement. This tutorial has missed alot.
Still wait for joy cons support
Its supported???? You mean the L3 R3 buttons in playstation console ?????
Hello, OnScreen controls not working on Android but working fine on unity, any ideas?
Thanks my new game get help
Why don't the callback Methods trigger whenever there is an input happening?
They just fire when the input(vector2 stick) changes.
That way i can't interrupt player walking and then have them walk after doing an action again, if they don't change the movement vector.
That sucks!
I am probably gonna do my own input class instead. Or is there an easy solution to this?
Don't put output in the callback, do it like this instead:
void Update(){
OutputMove();//transforms your output move results to your object every frame.
}
input move(callback value){
read value, result the value into to something your transform can use
}
Output Move(){
//transform code goes here using variable from callback.
}
You need two functions, one reading input callbacks, and one for outputting in update.
For Booleans, this is what I did to check if character is firing reading the right trigger callback:
public void InputFire(InputAction.CallbackContext value){
if (value.started) { autoFire = true; }
if (value.canceled) { autoFire = false; }
}
Then output is firing if that's true every frame, based on a fire rate delay timer, etc.
harder than all people thought
I experience a massive lag when I build and try to control characters in the build via a controller on a MAC.
Is there something I can do to remove this lag for build versions?
How do I use this with a Character Controller instead of a Rigidbody?
The Editor did not accept my request to furnish your scene automatically with an XR Rig, citing "Main Camera is not in the root of the hierarchy." So, I went ahead and added the Rig and VR camera manually. Everything works fine. But should I be concerned that now there are sort of 2 cameras doing the main rendering? I can't delete your legacy camera because then the game would not respond to inputs. Thanks!
did you find a solution to this, or just kept it this way?
Does player input manager support cinemachine?
It's great, but also it's a pity that you can't bind mouse with OnMouseDown etc. events to that :
If you are implying that you can't set an action to the press or the release of a button, that's not the case. You can check the state of the action with value.start (it's a bool equivalent to OnButtonDown), value.performed, and value.canceled (OnButtonUp). Look at the script of the attack in the video, he uses an if statement with value.start. If you were referring to something else i would like to know :)
@@AgusGamesPC Ok, so What I meant was that I can't (or don't know how to do that) use events like OnMouseDown, OnMouseEnter, OnMouseExit when using new input system. Everything is great when I want to use keys from keyboard, or gamepad, but when it comes to mouse-related game actions - I can't figure out if it's doable....
I wanted to execute some function when mouse hovers gameobject - with old input system I used events mentioned above, in new system - dunno ;x
@@Ravik-no6wx Oh ok, in that case, i don't know how to do that yet, sorry. But i'm certain there is a way, everything that could be done with the old system can be done with the new one, so... Let me know if you find out, i'll make sure to let you know if i do ^_^
i dont understand how i get the values
The setup is really clunky; Isnt there a way to do it in-script instead of using the inspector to setup events and have the values read straight up?
Yes use c# (Invoke C Sharp Events)
where you have the player controller script?
For some reason for me new input system doesn't work on GUI elements (menus), clicks of the mouse aren't registered. It works fine in game scenes though. Anyone else had this problem?
Do have have an EventSystem that is listening for input in the scene?
@@TheJScriptKid Yes, I googled the problem and seems like a lot of people have issue with it, haven't found solution yet
@@urskiz You say you have an EventSystem but have you actually updated said EventSystem to use the new 'Input System UI Input Module' component in place of the existing 'Standalone Input Module' component?
If you click on the EventSystem in the hierarchy and look at its components in the inspector, you'll see a "Standalone Input Module" component on it with a notice right at the top that it's incompatible with the new InputSystem and below that a button that says "Replace with InputSystemUIInputModule". This will replace the incompatible component with the required one.
It's something they missed in the tutorial and in theory they should probably add an option for it to be done automatically upon importation of the InputSystem, but alas it is a super simple solution to just click on the button for each EventSystem you have.
If you've done the above and can replicate the issue in a new project, you may want to report a bug for the version of Unity you're using.
that code wont work
The simple sample is not even using a keyboard, it uses a gamepad, new input system so buggy, its been 3 years
5:58 When did 'rawInputMovement' become the variable holding the direction we are moving in? At 0:40 the attribute holding our movement direction was 'inputDirection'.
You never mentioned if the old movement input code was disabled.
I didn't see you do anything to disable the old movement code.
You didn't mention if installing the Input System will disable the old movement code.
Yet, at 6:59, you are using "ASDW" as proof that the Input System you just hooked up is working, but the old code would also move the character with "ASDW". How do we know that it's not being moved with the old code? 8:23, no, using the gamepad didn't prove anything for movement because the left-analog stick on most gamepads is bound to "Vertical" and "Horizontal" by default. If you had bound it the the right-analog stick instead, and it worked, then that would have been proof.
the a button worked on the gamepad. but moreover. he shows the input debugger -_-
I can see a barbarian from clash of clans in the video
I did everything perfectly until you started talking about codes randomly threw me off so bad
this doesn;t work me :v
dont work nothing happends in fact gamepad works ui and mouse works but keyboard don t work and i get lot of unsupported device in debug
ok i delete the input change in project setting let empty in supported device make a new controller and it Works
like it when it works
i whish brackeys make a video tutorial about this...
First
using UnityEngine.InputSystem;
This is meaningless when you didn't show what the script is, and when the new user like me, would never get to know how to use input system after watch it.
Hello unity, I am your biggest fan. I was recently turning my old ping pong game into a multiplayer pong game using photon 1
. Could you pls help, I am struggling in instantiate of paddles at their respective locations.
5:52 this is getting called only once. This cannot be correct.
If the action 'movement' or 'attack' fires, it will emit an event which triggers the 'OnMovement' and 'OnAttack' methods. So they are getting called each time the player attacks or moves. It is correct. :)
It's event-driven, that's why. You no longer need to check if the user pressed a key in Update.
The video is missing parts of what is actually needed. Notice how rawInputMovement is initialized somewhere else. You update the transform.position in FixedUpdate() so when the OnMovement() function is triggered, the rawInputMovement variable effects the transform. Hope this helps. Took me a while to notice.
@@linnosmg I actually found the solution. Those events are only for changing the state of inputs. So when we press a button, the InputSystem sends an event and say this is the new state of that button. So we need to make a variable somewhere to save the last state of that input. After that we just need to use that variable in Update methods. That's it.
This tutorial explains basically nothing. Especially when you mention variables with no specified type.
Only 2 comments
And?
Y’all should work on graphics optimization. My computer be catching on fire when I play unity made games
Tell that to developers who made those games, not to Unity.
Yea it's UE4's input system basically.
worst input system I ever seen
hate 😡 it's not even a tutorial
Ok this was 100% useless to me right now. I have no idea how to connect the code to anything you are doing here.
I'm sorry but I hate it. The previous system was more beginner friendly, this is just a nightmare.