Strange Object Animation Issue

Started by cipberbloom, Tue 03/11/2020 03:03:32

Previous topic - Next topic

cipberbloom

Hiya, everyone -

I have an object in one room that is animating perfectly well with the following code:

Code: ags

function room_Load()
{
oCat.SetView(3);
oCat.Animate(0, 3, eRepeat, eNoBlock);
}



In another, no animation occurs. Same code, with the View and Object IDs changed accordingly, as well as a different delay (the Torches animation is meant to be faster).

Code: ags

function room_Load()
{
oTorches.SetView(4);
oTorches.Animate(0, 2, eRepeat, eNoBlock);
}


I've rechecked everything dozens of times with no change. Is there something simple I'm missing? Is this a bad way to code an object animation? BTW, there are no conflicting objects, nothing overlaps, no hotspots, walkable areas, nothing else there.

Thanks a million in advance.

Gilbert

In the room's properties, events tab (the 'lightening' icon), check whether the function room_Load() is linked to one of the events, and type the name of the function in the script to link it to the desired event if it doesn't appear in the list (for room_Load() it's usually linked to 'Enters room before fade-in').

It is a common mistake to just copy contents from the script of one room to another without properly linking the functions to events of the room.

cipberbloom

Thank you so much!  ;-D  Works a treat. :-D

SMF spam blocked by CleanTalk