问题
Earlier in the day i figured out why my game doesn't work on multiplayer. The reason is that I use the "get player controller" which gives me the index 0 so i can't work. But i use this to get location where my player has to look at (for the get hit result under cursor) and I also use that for make spawn the projectile that my player launch.
Do you have an idea of what i could use to make my game work on multiplayer.
Here are 2 screen. Let me know if you need some other informations.
event to launch a projectile; function rotate to face cursor
回答1:
On the Character or Pawn, you can simply use GetController and cast it to a PlayerController
回答2:
Remember that you cannot get a client's player controller from another client. Controllers exist only on server and who owns it (the player).
来源:https://stackoverflow.com/questions/64902940/what-should-i-use-instead-of-get-player-controller-to-make-a-multiplayer-game