- Found in:
- Vanilla
Description
Wiki Description
Casts this spell from the specified object reference, optionally toward a target object reference.
Documentation Comment
Cast this spell from an ObjectReference, optionally toward another.
Caveats
CK Wiki - Notes
- This function casts the spell instantaneously. This is mainly desirable only for non-actors, because it will not animate an actor. For instance, the spell will be cast even if the actor's hands are not readied.
- If you wish to make an actor cast a spell using all the normal spellcasting behaviors, please instead use an AI package that includes the UseMagic procedure.
- Actor races can be set to cast magic only in the direction that the actor is facing; if the source is an actor with this racial setting, the target will be ignored.
- Warning: Be careful casting spells in paused menus. Attempting to cast a Fire and Forget spell while in Pipboy Menu causes the script to stop executing the function until it can cast the spell, which is when Pipboy Menu is closed. This also prevents events on the script from processing as well until Pipboy Menu is closed. This is a primary reason that Survival Mode uses Potions instead of Spells for its effects, since Potions do not halt Papyrus processing while in Pipboy Menu).
Parameters
ObjectReferenceakSource
CK Wiki Description
The ObjectReference from which to cast the spell. The source must be able to cast this spell.
ObjectReferenceakTarget=NONE
CK Wiki Description
An optional ObjectReference at which to aim the spell. If None is passed and the spell needs a direction, it will be aimed in a default direction.
- Default:None
Examples
No human-generated examples found for this function.
Auto-Generated Example
ObjectReference myObjectReference__akSource
ObjectReference myObjectReference__akTarget
mySpell__toCallFunctionOn.Cast(myObjectReference__akSource, myObjectReference__akTarget)Related Pages
Additional References
View this function’s page on the Fallout 4 Creation Kit Wiki
