Game Development Community

TorqueX 2D, setting T2DAnimationData help

by Andre Clark · in Torque Game Engine · 07/18/2008 (12:30 am) · 0 replies

In Torque X, I want to set the T2DAnimationData of a component in code, but I can't figure out a straight forward approach.

Let's say I have my PlayerActorComponent, Play1.
I want to set the RunAnim for Play1 in a function.

I've tried:
Play1.RunAnim = TorqueObjectDatabase.Instance.FindObject("RunAnimation");

Where "RunAnimation" is the name of the animation data block created in the TGB.

I've tried a few other things that seemed straight forward, but nothing seems to work. Is there an easy way to change this property?

Any insight would be greatly appreciated.