Topic: Determine local player from ControlsScript

I have a method subscribed to the UFE.OnGameBegin event.

The event has two ControlsScript parameters for each player.

How do I determine which player is the local player and which player is CPU player or remote player (in case of online p2p match)?

Regards.

Share

Thumbs up Thumbs down

Re: Determine local player from ControlsScript

for local or remote player, you can use this:

UFE.GetLocalPlayer()

or

UFE.GetRemotePlayer()

These functions will return the values 1 or 2 (which player is local or remote)

to know which one is CPU, use this:

UFE.GetCPU(1)

or

UFE.GetCPU(2)

These will return true or false if the given parameter (1 or 2) is controlled by the CPU or not.

Like UFE? Please rate and review us on the Asset Store!
Questions about the Forum? Check out our Karma FAQ.
Don't forget to check our discord channel.