0

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

  • according to a post from unreal engine answer hub, maybe try to make the vector calculation inside a function that runs client side then pass it as a parameter to the function that runs server side which effectivly spawns the actor boule de feu (https://answers.unrealengine.com/questions/586472/spawning-of-actors-in-multiplayer.html) – DeimosPhx Nov 19 '20 at 10:58

2 Answers2

3

On the Character or Pawn, you can simply use GetController and cast it to a PlayerController

3

Remember that you cannot get a client's player controller from another client. Controllers exist only on server and who owns it (the player).