Jump to content

Animating Weapons On Command?


Recommended Posts

I'm trying to make a weapon that animates on draw/sheathe and on equip. I've tried using the script commands PlayAnimation on the weapon itself, and PlaySubGraphAnimation on the user. Neither one seems to work. I know "SubGraph" scripts work on shields (such as Auriel's Shield), do weapons not count as "SubGraph" objects?

 

Here's the script I've been trying to use (I'm using "Open" and "Close" as the animation names for now, though I'd probably change those later to avoid clashing with something else):

Scriptname AnimatedWeaponScript extends ObjectReference 

Actor Property SelfRef  Auto Hidden
Event OnEquipped(Actor AkActor)
SelfRef = AkActor
RegisterForAnimationEvent(selfRef, "WeaponDraw")
RegisterForAnimationEvent(selfRef, "WeaponSheathe")
 
SelfRef.PlaySubGraphAnimation("Close")
Debug.Notification("Equipped")
EndEvent
Event OnAnimationEvent(ObjectReference AkSource, string AsEventName)
if(akSource == SelfRef)
  if (AsEventName == "WeaponDraw")
   SelfRef.PlaySubGraphAnimation("Open")
Debug.Notification("Drawn")
  Elseif (AsEventName == "WeaponSheathe")
   SelfRef.PlaySubGraphAnimation("Close")
Debug.Notification("Sheathed")
  EndIf
EndIf
EndEvent

The animations don't play at any point.

 

Does anybody have any ideas on how I could get this to work (Without doing something like taking up an armor slot, or using enchant art)?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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