Nexus12User12 Posted January 12, 2014 Share Posted January 12, 2014 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 More sharing options...
Nexus12User12 Posted January 12, 2014 Author Share Posted January 12, 2014 I found a solution by myself. If I use obj.SetMotionType(4) the object is animated correctly. Link to comment Share on other sites More sharing options...
Recommended Posts