Background for Skyrim SE
Member of the Actor script
voidfunctionKeepOffsetFromActor(ActorarTarget, floatafOffsetX, floatafOffsetY, floatafOffsetZ, floatafOffsetAngleX=0.0, floatafOffsetAngleY=0.0, floatafOffsetAngleZ=0.0, floatafCatchUpRadius=20.0, floatafFollowRadius=5.0)Native

Description

Wiki Description

Forces the specified actor into a state where it will attempt to keep a given offset from another actor

Documentation Comment

Sets the actor to a mode where it will keep a given offset from another actor


Caveats

CK Wiki - Notes

  • The default values will cause the follower to continually run into the target, use larger values instead.
  • This is nifty if you want an NPC to walk next to another.
  • This function can be used as a way to force actors to walk in a direction, similar to Obscript's PlayGroup function. See Here.

Parameters

ActorarTarget

CK Wiki Description

the target actor

floatafOffsetX

CK Wiki Description

the offset from the target actor, in the actor's body space (so positive X is right of the actor), X

floatafOffsetY

CK Wiki Description

the offset from the target actor, in the actor's body space, Y

floatafOffsetZ

CK Wiki Description

the offset from the target actor, in the actor's body space, Z

floatafOffsetAngleX=0.0

CK Wiki Description

the offset angle from the target actor, X (degrees - rarely used)

floatafOffsetAngleY=0.0

CK Wiki Description

the offset angle from the target actor, Y (degrees - rarely used)

floatafOffsetAngleZ=0.0

CK Wiki Description

the offset angle from the target actor, Z (degrees - most commonly used)

floatafCatchUpRadius=20.0

CK Wiki Description

the radius at which the actor would run to catch up (anyone outside a radius of 20 will run to catchup)

floatafFollowRadius=5.0

CK Wiki Description

the radius at which the actor won't move (anyone within a radius of 5 will not move)


Examples

; Have the stalker keep close to the player
Stalker.KeepOffsetFromActor(Game.GetPlayer(), 0.0, 0.0, 20.0)
; Have the stalker keep close to the player with a larger follow radius
Stalker.KeepOffsetFromActor(Game.GetPlayer(), 0.0, 0.0, 20.0, afFollowRadius = 10.0)
; Cause Runner to run forwards (lower offset magnitude will reduce speed)
Runner.KeepOffsetFromActor(Runner, 0.0, 0.0, -100.0, afFollowRadius = 0.0)

Auto-Generated Example

Actor myActor__arTarget
float myFloat__afOffsetX
float myFloat__afOffsetY
float myFloat__afOffsetZ
float myFloat__afOffsetAngleX
float myFloat__afOffsetAngleY
float myFloat__afOffsetAngleZ
float myFloat__afCatchUpRadius
float myFloat__afFollowRadius

myActor__toCallFunctionOn.KeepOffsetFromActor(myActor__arTarget, myFloat__afOffsetX, myFloat__afOffsetY, myFloat__afOffsetZ, myFloat__afOffsetAngleX, myFloat__afOffsetAngleY, myFloat__afOffsetAngleZ, myFloat__afCatchUpRadius, myFloat__afFollowRadius)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.