Best Practices & Getting Started Tutorials

Decided to make a few of these to help folks that are new, or struggling (as I did) to move from the Old Input Manager to the New Input System.

Hope these relieve some of the pain!

PlayerInput - SendMessage

PlayerInput - UnityEvents

PlayerInput - C# Events

InputActionAsset C# Events Without PlayerInput

InputActionAsset Generate C# Class and GetButton/Up/Down extensions

3 Likes

Hey! How do I read mouse input to get the position of the mouse on the screen?

http://angryarugula.com/unity/teaching/Input/InputSystemMouseExample.unitypackage

Been meaning to do a video on some Mouse and Touch stuff sooner or later - for now, example package!

Hi Fenrisul!
That’s a subscribe and a like from me.
Would it be possible to put up brief descriptions for the Youtube videos to help my jump around?

Added Part 1 of 2 for Local Multiplayer / couch co-op with gamepads

edit
You know what…there’s some really really ugly behavior when using UnityEvent callbacks here… I’m going to redo this tutorial and file a proper bug report. UnityEvent’s are called twice with the same phase for each action… and the Player Join event doesn’t consume the event so its extra confusing when your prefab is getting input before it has a chance to run Awake…

2 Likes

Thank you for pointing out that the generated c# class is meant as an alternative to PlayerInput. Other tutorials and guides I’ve seen make it seem like the former is the way to do c# events with Input System, which ends of being a dead end if you’re doing local multiplayer. Also, you can get individual actions and subscribe to them from PlayerInput using FindActionMap and FindAction. (eg. MyPlayerInput.actions.FindActionMap(“ActionMapName”).FindAction(“ActionName”) )

Thank you for the tutorials did you try the other options for triggering the joining of a Player and see what happens :smile:,
i was supprised to see that till version 1.2 if you wanted the joining to be triggered when a specific button is pressed if you used for example 2 gamepads only the first one would be joined.( on 1.3 it is fixed with 2 gamepads)
Not to mention that if you use on-screen components and player input nothing works anymore if you wire everything (add the action maps to Playinput, add the multiplayer event system everywhere).
Somehow these components don’t seem to work well together so far and probably because of complexity they are still far away from being ready for production

Hi good concise videos. What would be the most performant solution when it comes to input delay/lag?

Nice videos!
I watched them all, but is there any way I can spawn players with different prefabs?
In my current game I have 2 players but each plays as a different character.

You’re my hero!