GetSex - ActorBase

Revision as of 10:46, 13 December 2020 by imported>Rasikko (Added notes section stating to call this on the LeveledActorBase to obtain the sex of the spawned leveled actor, otherwise you'll get the base object's sex in the editor(almost always male).)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: ActorBase Script

Obtains this actor's sex.

SyntaxEdit

int Function GetSex() native

ParametersEdit

None.

Return ValueEdit

The actor's sex, which is one of the following:

  • -1: None
  • 0: Male
  • 1: Female

NotesEdit

  • To check for the sex of a Leveled Actor spawned in the world and not the Leveled Actor's ActorBase in the Editor, call this function on GetLeveledActorBase - Actor.

ExamplesEdit

; Is the player male?
ActorBase PlayerBase = Game.GetPlayer().GetActorBase()
if (PlayerBase.GetSex() == 0)
  Debug.Trace("Player is male")
endIf

See AlsoEdit