Jump to content

Firing a spell at player's location


Recommended Posts

I put together this script in order to fire a spell at the player's location. Player controls are disabled so I thought this should give the location for the script. The spell fires over player's head - misses. Could it be the spell? Is there a better way? The delay is because other stuff is happening and to make sure player is disabled before spell fires.

 

Actor Property PlayerREF Auto
Float Property Delay Auto
ObjectReference Property SpellSource Auto
Spell Property MySpell Auto

EVENT onTriggerEnter(ObjectReference akActionRef)
if akActionRef == PlayerRef
Game.DisablePlayerControls()
Utility.Wait(Delay)
debug.notification("Fire Spell")
MySpell.cast(SpellSource, self)
EndIf
EndEvent

 

Link to comment
Share on other sites


Event OnTriggerEnter(ObjectReference akActionRef)

if akActionRef == PlayerRef
Game.DisablePlayerControls()
Utility.Wait(Delay)
debug.notification("Fire Spell")
MySpell.cast(SpellSource, akActionRef)
endif

EndEvent
Edited by Rasikko
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...