You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Photon中PhotonView的CreatorActorNr、OwnerActorNr与ControllerActorNr的区别是什么?

Difference Between CreatorActorNr, OwnerActorNr, and ControllerActorNr in PhotonView

Hey there! Let's break down these three PhotonView properties clearly—they're easy to mix up but serve distinct roles in networked games with Photon.

CreatorActorNr

  • What it is: This is the Actor Number of the player who originally instantiated the PhotonView and its associated GameObject across the network.
  • Key detail: This value is fixed once the object is spawned. Even if ownership or control gets transferred later, the creator remains the same forever.
  • Common use cases:
    • Tracking who initially spawned an object (like a grenade, pickup, or turret) for scoring or in-game accountability
    • Restricting specific actions to only the original creator (e.g., letting them recall a deployed turret they placed)

OwnerActorNr

  • What it is: This represents the current authority holder of the PhotonView's GameObject. In Photon, ownership defines who has permission to modify the object's state, sync changes, or transfer ownership to other players.
  • Key detail: This can change during runtime using methods like PhotonView.TransferOwnership(). By default, the creator is the initial owner, but this can be passed to other players as needed.
  • Common use cases:
    • Managing player-controlled avatars (if a player takes over a bot character, you'd transfer ownership to them here)
    • Ensuring only the owner can trigger networked actions tied to the object (e.g., firing a weapon attached to their character)

ControllerActorNr

  • What it is: This is the Actor Number of the player who's currently actively controlling the PhotonView's object—specifically for input-driven actions. This is most relevant for objects using components like PhotonTransformView that sync movement based on player input.
  • Key detail: This doesn't always match the OwnerActorNr. For example, if an owner lets another player temporarily drive their vehicle, the controller would be the driver, while the owner stays the original player.
  • Common use cases:
    • Syncing input-based movement (like a player moving their character or steering a car)
    • Displaying who's currently in control of an object (e.g., showing a "Driver" tag above a vehicle)

Quick Cheat Sheet for Differences

  • CreatorActorNr: Fixed, original spawner—never changes post-instantiation.
  • OwnerActorNr: Current authority holder—can be transferred between players.
  • ControllerActorNr: Current input controller—may differ from the owner, tied to active, input-based control.

内容的提问来源于stack exchange,提问作者Haseeb Zahid

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 13:52:52