In case your icons do not show up, make sure you've placed them into the "Sprite Asset" folder inside TextMesh Pro -> Resources -> Sprite assets Here are a few pointers of where to look for more info on how to get a string from your binding and/or how to get which input device type is currently active: This for getting a binding docs.unity3d.com/Packages/com.unity.inputsystem@1.4/manual/ActionBindings.html#displaying-bindings And here's one for getting the Binding Index by using a binding mask docs.unity3d.com/Packages/com.unity.inputsystem@1.4/api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_GetBindingIndex_UnityEngine_InputSystem_InputAction_UnityEngine_InputSystem_InputBinding_ Here's the documentation on getting the current control scheme (though I have read that it doesn't work if you generate your C# script and my tests seemed to agree with that statement) docs.unity3d.com/Packages/com.unity.inputsystem@1.1/api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_currentControlScheme I have come across tutorials that mentioned saving the currently active input device to a value when input devices changes, though it has been a while and I can't seem to find my links anymore. Basically, they used this: docs.unity3d.com/Packages/com.unity.inputsystem@1.4/api/UnityEngine.InputSystem.InputDeviceChange.html If anybody knows of a great, applies-to-every-way-of-implementation kind of way, I would super appreciate to get to know about it =)!
this is one of the most well made tutorials I've seen on TH-cam, most youtubers just write the code and narrate it on the fly but you took the time to walk through each line in the order that made the most sense instead of going in a linear fashion
Thank you so much! I learned coding through TH-cam Tutorials and when I tried creating them for myself, I wasn't happy with the Code-while-talking approach, thus I try to organize Code and narration a bit differently. I'm super glad to hear you enjoy that style :)
Love your content, Piti! Hoping to send more people on the patg of the New Input System and your Video had helped me a lot. Glad to hear you found it useful!
Dude! This is awesome. All your tutorials are awesome, but this one got me excited, not just for the button prompts but also the sprite-atlasing tool, which is something I needed.
Thank you :D! Makes me super happy to read you enjoyed it. If you need any more Sprite based infos for text boxes, I made a video about that, as well :) th-cam.com/video/gJt6vSSlG3I/w-d-xo.html
Thank you very much! I love Scriptable Objects where they make sense, and if I see a reason to use them, I will :) It makes handling a lot of things so much easier.
It's so rare that other creators use them in tutorials. I think simple examples like this really make them accessible to people still learning what they are.
Note, with input system 1.4 , you will have an 'action' property on the action needed that gives you the name, so you can change Interact to that action (for more dynamic stuff). There's also effectivePath on the InputBinding which does not have the name.
@emadadel4 the InputBinding has an effectivePath property in the from "/K" . From the InputAction, find the correct binding. The generated InputActions class (the Unity input system generates these), has a FindAction method that can take a name, like "Player/Move" and return an InputAction with all bindings. Use this to build a system that can take the "Player/Move" text and return the right sprite.
Waouh 😮🤩 Awesome tuto, again! 👏😀 PS: it is sometimes hard to see what you're doing in your video with a smartphone sized screen, if it's not too much work, a zoom in section would be really appreciated for the code/text part 😇
Thanks! 😃 And thanks for the feedback as well :) I'll try to find a good way to handle that in my upcoming tutorials, but the next one will probably have the same issue as that's already done waiting to be published ;) But after that, I'll increse the text size!
@@ChristinaCreatesGames Thank you for taking my feedback into account ❤ It's not a problem if the next one is also in the same format, I'm more glad to know that the video is already done 🤷🏻♂️😁 For my personal comfort, I watch TH-cam videos on my phone during breaks but your content is worth reviewing afterwards on a computer 😉
Oh, good to know ;) I had a look into my analytics and it seems that most of my watchers are watching on computer's monitors, but a friend told me he's also watching these kinds of tutorials on his phone during breaks as well. So, that's already two of you mentioning the same issue 😉 I currently have the video for in two weeks on my desk and will change the visuals a bit to make it more mobile friendly👍
While I don't think there is anything wrong with replacing text with sprites for Gamepad, I think replacing them like this for keyboard keys is going to return wrong results for anything but US QWERTY keyboard layout - don't know if there is any other optimal solution outside of just displaying keyboard keys as a raw text using action.GetBindingDisplayString().... and if I remember correctly action.bindings[0].ToDisplayString() already displays keyboard keys ignoring keyboard layout.
In case your icons do not show up, make sure you've placed them into the "Sprite Asset" folder inside TextMesh Pro -> Resources -> Sprite assets
Here are a few pointers of where to look for more info on how to get a string from your binding and/or how to get which input device type is currently active:
This for getting a binding
docs.unity3d.com/Packages/com.unity.inputsystem@1.4/manual/ActionBindings.html#displaying-bindings
And here's one for getting the Binding Index by using a binding mask
docs.unity3d.com/Packages/com.unity.inputsystem@1.4/api/UnityEngine.InputSystem.InputActionRebindingExtensions.html#UnityEngine_InputSystem_InputActionRebindingExtensions_GetBindingIndex_UnityEngine_InputSystem_InputAction_UnityEngine_InputSystem_InputBinding_
Here's the documentation on getting the current control scheme (though I have read that it doesn't work if you generate your C# script and my tests seemed to agree with that statement)
docs.unity3d.com/Packages/com.unity.inputsystem@1.1/api/UnityEngine.InputSystem.PlayerInput.html#UnityEngine_InputSystem_PlayerInput_currentControlScheme
I have come across tutorials that mentioned saving the currently active input device to a value when input devices changes, though it has been a while and I can't seem to find my links anymore. Basically, they used this: docs.unity3d.com/Packages/com.unity.inputsystem@1.4/api/UnityEngine.InputSystem.InputDeviceChange.html
If anybody knows of a great, applies-to-every-way-of-implementation kind of way, I would super appreciate to get to know about it =)!
this is one of the most well made tutorials I've seen on TH-cam, most youtubers just write the code and narrate it on the fly but you took the time to walk through each line in the order that made the most sense instead of going in a linear fashion
Thank you so much! I learned coding through TH-cam Tutorials and when I tried creating them for myself, I wasn't happy with the Code-while-talking approach, thus I try to organize Code and narration a bit differently. I'm super glad to hear you enjoy that style :)
you have some of the best unity tutorials out there. Clear, concise, and beautifully illustrated.
Wow, thank you! Glad you like them ❤️
Awwww! Thank you for mentioning my video! This tutorial is great! I really love the idea, I am going to be using that sooner or later :).
Love your content, Piti! Hoping to send more people on the patg of the New Input System and your Video had helped me a lot. Glad to hear you found it useful!
@@ChristinaCreatesGames awww…
Dude! This is awesome. All your tutorials are awesome, but this one got me excited, not just for the button prompts but also the sprite-atlasing tool, which is something I needed.
Thank you :D! Makes me super happy to read you enjoyed it. If you need any more Sprite based infos for text boxes, I made a video about that, as well :) th-cam.com/video/gJt6vSSlG3I/w-d-xo.html
Great job again! I like that you include SOs in your tutorials in a sensible way.
Thank you very much! I love Scriptable Objects where they make sense, and if I see a reason to use them, I will :) It makes handling a lot of things so much easier.
It's so rare that other creators use them in tutorials. I think simple examples like this really make them accessible to people still learning what they are.
Note, with input system 1.4 , you will have an 'action' property on the action needed that gives you the name, so you can change Interact to that action (for more dynamic stuff). There's also effectivePath on the InputBinding which does not have the name.
Thank you for the Info! I hadn't know that =)
@emadadel4 I feel like I responded to this but my comments are gone
@emadadel4 the InputBinding has an effectivePath property in the from "/K" . From the InputAction, find the correct binding. The generated InputActions class (the Unity input system generates these), has a FindAction method that can take a name, like "Player/Move" and return an InputAction with all bindings. Use this to build a system that can take the "Player/Move" text and return the right sprite.
I enjoy every single one of your videos!
Thank you =D! Super glad to hear it!
Very informative and straight to the point. Helped me a lot, thank you.
Thank you very much for the feedback 😊!
Waouh 😮🤩 Awesome tuto, again! 👏😀
PS: it is sometimes hard to see what you're doing in your video with a smartphone sized screen, if it's not too much work, a zoom in section would be really appreciated for the code/text part 😇
Thanks! 😃
And thanks for the feedback as well :) I'll try to find a good way to handle that in my upcoming tutorials, but the next one will probably have the same issue as that's already done waiting to be published ;) But after that, I'll increse the text size!
@@ChristinaCreatesGames
Thank you for taking my feedback into account ❤
It's not a problem if the next one is also in the same format, I'm more glad to know that the video is already done 🤷🏻♂️😁 For my personal comfort, I watch TH-cam videos on my phone during breaks but your content is worth reviewing afterwards on a computer 😉
Oh, good to know ;) I had a look into my analytics and it seems that most of my watchers are watching on computer's monitors, but a friend told me he's also watching these kinds of tutorials on his phone during breaks as well. So, that's already two of you mentioning the same issue 😉 I currently have the video for in two weeks on my desk and will change the visuals a bit to make it more mobile friendly👍
Very useful video
Glad you liked it, thanks a lot 😊!
Is there a way to do this with the UI toolkit?
I don't yet know enough about the UI toolkit to be able to answer that, sorry.
While I don't think there is anything wrong with replacing text with sprites for Gamepad, I think replacing them like this for keyboard keys is going to return wrong results for anything but US QWERTY keyboard layout - don't know if there is any other optimal solution outside of just displaying keyboard keys as a raw text using action.GetBindingDisplayString().... and if I remember correctly action.bindings[0].ToDisplayString() already displays keyboard keys ignoring keyboard layout.