Difference between revisions of "GetSex - ActorBase"
Jump to navigation
Jump to search
imported>Chesko m (Modified example to use GetActorBase() instead of GetBaseObject() as ActorBase.) |
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).) |
||
Line 18: | Line 18: | ||
*0: Male | *0: Male | ||
*1: Female | *1: Female | ||
== Notes == | |||
* 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]]. | |||
== Examples == | == Examples == |
Latest revision as of 09:46, 13 December 2020
Member of: ActorBase Script
Obtains this actor's sex.
Syntax[edit | edit source]
int Function GetSex() native
Parameters[edit | edit source]
None.
Return Value[edit | edit source]
The actor's sex, which is one of the following:
- -1: None
- 0: Male
- 1: Female
Notes[edit | edit source]
- 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.
Examples[edit | edit source]
; Is the player male?
ActorBase PlayerBase = Game.GetPlayer().GetActorBase()
if (PlayerBase.GetSex() == 0)
Debug.Trace("Player is male")
endIf