PickupOnTrigger









How do I use Pickup On Trigger
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: PickupItem.cs Copy
59     public void OnTriggerEnter(Collider other)
60     {
61         // we only call Pickup() if "our" character collides with this PickupItem.
62         // note: if you "position" remote characters by setting their translation, triggers won't be hit.
63
64         PhotonView otherpv = other.GetComponent();
65         if (this.PickupOnTrigger && otherpv != null && otherpv.isMine)
66         {
67             //Debug.Log("OnTriggerEnter() calls Pickup().");
68             this.Pickup();
69         }
70     }

PickupOnTrigger 112 lượt xem

Gõ tìm kiếm nhanh...