SetActorOwner - ObjectReference: Difference between revisions
Jump to navigation
Jump to search
imported>Jlundin No edit summary |
m (Convert source tags to syntaxhighlight) |
||
| Line 6: | Line 6: | ||
== Syntax == | == Syntax == | ||
< | <syntaxhighlight lang="papyrus"> | ||
Function SetActorOwner(ActorBase akActorBase) native | Function SetActorOwner(ActorBase akActorBase) native | ||
</ | </syntaxhighlight> | ||
== Parameters == | == Parameters == | ||
| Line 17: | Line 17: | ||
== Examples == | == Examples == | ||
< | <syntaxhighlight lang="papyrus"> | ||
; Clear ownership on the sword, which allows the player to take it without stealing it | ; Clear ownership on the sword, which allows the player to take it without stealing it | ||
SwordProperty.SetActorOwner(NONE) | SwordProperty.SetActorOwner(NONE) | ||
</ | </syntaxhighlight> | ||
<br> | <br> | ||
< | <syntaxhighlight lang="papyrus"> | ||
; Set the player as the owner of the sword (other actors will "steal" it) | ; Set the player as the owner of the sword (other actors will "steal" it) | ||
SwordProperty.SetActorOwner(Game.GetPlayer().GetActorBase()) | SwordProperty.SetActorOwner(Game.GetPlayer().GetActorBase()) | ||
</ | </syntaxhighlight> | ||
<br> | <br> | ||
< | <syntaxhighlight lang="papyrus"> | ||
; Make Bob the owner of the sword | ; Make Bob the owner of the sword | ||
SwordProperty.SetActorOwner(Bob.GetActorBase()) | SwordProperty.SetActorOwner(Bob.GetActorBase()) | ||
</ | </syntaxhighlight> | ||
== See Also == | == See Also == | ||
*[[ObjectReference Script]] | *[[ObjectReference Script]] | ||
*[[GetActorOwner - ObjectReference]] | *[[GetActorOwner - ObjectReference]] | ||
Latest revision as of 21:18, 5 September 2026
Member of: ObjectReference Script
Sets the actor base as the owner of this object.
Syntax[edit | edit source]
Function SetActorOwner(ActorBase akActorBase) nativeParameters[edit | edit source]
- akActorBase: The ActorBase to set as this object's owner. If None, will clear ownership.
Return Value[edit | edit source]
None.
Examples[edit | edit source]
; Clear ownership on the sword, which allows the player to take it without stealing it
SwordProperty.SetActorOwner(NONE)
; Set the player as the owner of the sword (other actors will "steal" it)
SwordProperty.SetActorOwner(Game.GetPlayer().GetActorBase())
; Make Bob the owner of the sword
SwordProperty.SetActorOwner(Bob.GetActorBase())