Jump to content

TranslateToRef Animation does not work


Nexus12User12

Recommended Posts

I am trying to create a spell similar to Accio from the Harry Potter Series. Therfor I wrote a script, using TranslateToRef on the target ObjectReference. It seems to work, because the duration between casting the spell and adding the object to the inventory increases with the distance between caster and object. But the animation of TranslateToRef does not work on takeable objects.

 

I tried a simple script on a static object to test the TranslateTo/TranslateToRef function and this one worked without any problems. The same script on a movable kettle had the same issues as described.

 

This is my script:

Scriptname SPOSpellAccioScript extends activemagiceffect  

;I saved the target object into a ReferenceAlias. If the target object is not valid (not a takeable object) the ReferenceAlias is linked to the player.

ReferenceAlias Property CurrentObject Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
  ObjectReference obj = CurrentObject.GetReference()

  If obj != Game.GetPlayer()
    obj.TranslateToRef(akCaster, 400)

    While akCaster.GetDistance(obj) > 100
    EndWhile

    akCaster.AddItem(obj)
  EndIf
EndEvent

Is it possible to show this animation?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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