user14660859
user14660859

Reputation:

What should I use instead of "get player controller" to make a Multiplayer game (Top Down Game Unreal Engine)

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

Upvotes: 0

Views: 27076

Answers (2)

Adriano Sordi
Adriano Sordi

Reputation: 61

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

Upvotes: 3

Robert Cober
Robert Cober

Reputation: 31

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

Upvotes: 3

Related Questions