findOwningPlayer
findOwningPlayer(
world,entity):PlayerEntity|null
The player whose page receives entity’s Reach.Owner traits, or
null where none does: the player entity itself; else the first player
entity up its setOwner chain, so a pet the player owns, or a sword
the player’s pet owns, is the player’s. Else the player who controls
it. An owner chain that names no player leaves it to its controller,
and an entity with neither reaches no page. As Unreal’s GetNetOwner,
which walks the owner chain to a player controller.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
entity |
Entity |
Returns
Section titled “Returns”PlayerEntity | null
Example
Section titled “Example”const owner = findOwningPlayer(world, chest);