Background for Skyrim SE
Member of the ObjectReference script
voidfunctionPushActorAway(ActorakActorToPush, floataiKnockbackForce)Native

Description

Wiki Description

Knocks back the specified actor away from this object with the specified amount of force, as if an explosion had gone off.

Documentation Comment

Pushes the passed-in actor away from this object, using the passed in knockback force to determine the speed


Caveats

CK Wiki - Notes

  • Use an XMarkerHeading object to control the exact direction in which the actor will be pushed.
  • The force argument can be negative to pull actors toward your ObjectReference. (Before you ask, yes, someone beat you to it and made a Katamari mod out of this.)
  • The push is applied via an explosion, and as such is affected by the fMagicExplosion* game settings.
  • Running PushActorAway on the target of an idle animation started with a function such as Actor.PlayIdleWithTarget(...) can cause unusual behavior. For example, after targeting an actor with a kill move, the actor may stand back up, wait a few moments, and then collapse again.
  • Running PushActorAway on newly spawned Actor can lead to a crash to desktop. To prevent this, check that the 3D is loaded on the Actor with ObjectReference.Is3DLoaded() before doing PushActorAway.
ObjectReference MyActor = XmarkerkRef.PlaceAtMe(MyActorBase)
If (MyActor.Is3DLoaded())
    XmarkerRef.PushActorAway(MyActor as Actor, 50.0)
EndIf

Parameters

ActorakActorToPush

CK Wiki Description

The actor to push away.

floataiKnockbackForce

CK Wiki Description

The amount of force to apply to the target actor.


Examples

ExplosionMarker.PushActorAway(Bill, 10.0)

Auto-Generated Example

Actor myActor__akActorToPush
float myFloat__aiKnockbackForce

myObjectReference__toCallFunctionOn.PushActorAway(myActor__akActorToPush, myFloat__aiKnockbackForce)

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.