Jump to content

Best Practice for comparing Actor objects?


Recommended Posts

Posted

Assuming you have a reference to an Actor, either from the HookActors() method or some event callback, and you want to compare that Actor to PlayerRef? What is the best way to test if that reference is the same Actor as the Player? == ? .GetName() == .GetName(), etc?

 

Thanks

Posted

Simpliest:

if ActorRef == Game.GetPlayer()
   ;// Player stuff
endIf

Best Practice:

Actor property PlayerRef auto

if ActorRef == PlayerRef
   ;// Player stuff
endIf

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...