Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Skeller53 on Sun 30/01/2005 04:20:48

Title: Trigger Action Based on Certain Animation Frame? [SOLVED]
Post by: Skeller53 on Sun 30/01/2005 04:20:48
Is there a way to trigger an action based upon a specific frame in an object's animation? For example, if you want to trigger a collision between object A and object B, but you only want it to occur/be detected on the third frame of object A's animation, is there a way to do that?

As always, many thanks for any help.
Title: Re: Trigger Action Based on Certain Animation Frame?
Post by: Proskrito on Sun 30/01/2005 09:00:53
i think you can't get the cuerrent frame of an object, but you can get the sprite number, so you could write down the sprite number of that frame, lets say its X, and write:
if (GetObjectGraphic(objA)==X && AreObjectsColliding(objA,objB)) {
do something;
}
Title: Re: Trigger Action Based on Certain Animation Frame?
Post by: Skeller53 on Mon 31/01/2005 03:11:02
Perfect! Just what I wanted. Thank you so much.

Don't know how I missed that in the object function list. Of the many services this board provides, one is to get novices like me to approach problems from different angles. It's great.