So I’m currently in the process of making an elevator for my game, where the player can walk into the lift, press F to get their mouse cursor and press the floor button they want to go to. I currently have it working in a SP environment using the Get Player Controller node, however I need this to work over multiplayer. I realize that the Get Player Controller node doesn’t work in MP but whenever I use the Cast to Player Controller via Get Owner, the cast always fails. Any thoughts on the best way to sort this out? Currently if I use the Get Player Controller is makes the cursor show up on all connected clients which needless to say isn’t optimal.
If you use Get Player Controller → Cast to Your Controller → bShowMouseCursor locally on the player who is interacting, it shows it on all connected clients? That doesn’t make sense/sounds like a bug.
Using that setup only works on the server because if I’m remembering correctly, the Get Player Controller node only references the player index 0.
To be honest, using the cursor is quite a clunky way of interacting with buttons. I would love to know how to use the line trace so that the player could simply look at the button and press F.
The clients still have a player controller, but they only have their own (0). The server has its own (0) plus all of the client controllers (1+).
Get Player Controller index 0 done locally on each player will return themselves, which is why I find it odd that its turning on the mouse on everyone.
The UMG Inventory series of tutorial videos has an example of how you can do pickups without the mouse. I think it starts with this part:
UMG itself should work without any issues whatsoever… may I ask how exactly you implemented this? Is it a regular cast? From where to what?
Because usually you should do all the event handling in your controller and then just call some interface or event from another actor (ideally an interface. If you use F you probably want one for all possible interactions which should work with F so you just have to implement the interface in some actor and code the behavior but you wouldn’t need any additional work in your player controller).
Like this you also have full control about everything directly in your controller. And stuff like which UMG to open and what variables to provide can simply be the return value from calling the interface function.