Author Topic: Playing custom animation  (Read 604 times)

So I am working on something. It has custom animations obviously.

Code: [Select]
function GolfClubImage::onCharge(%this, %obj, %slot)
{
%this.playthread(2, GolfReady);
}

function GolfClubImage::onAbortCharge(%this, %obj, %slot)
{
%obj.playthread(2, root);
}

function GolfClubImage::onFire(%this, %obj, %slot)
{
%this.playthread(2, GolfSwing);
Parent::onFire(%this, %obj, %slot);
}

That is what the part is. I am wondering if I use something other than %obj or do I not use playthread on custom animations? Please help

I also tried instead of %this I tried %obj but I am pretty sure %obj is your player and I though %this was the item but I am not for sure. Correct me if I am wrong.

(Assuming it's the image that needs to animate)
%this would just be the datablock (images are odd that way), but there is an easier (from some points of view) way to make an image animate.

If you look at the rocket launcher, it has a few lines like
Code: [Select]
   stateSequence[5]                = "TrigDown";
What that is saying is that during state 5, the image should use the "TrigDown" sequence (animation). In a similar way, you can have your image play any animation sequence during a specific state


%obj is the player itself, so %obj.playthread(...); is only used for animations that the player's shape has, which is almost always going to be limited to the default set.

(If you already know some of this, consider it a gift to someone who doesn't that will inevitably read this)

Alright I will try it out later and tell you how it works