Animating character on room_AfterFadeIn? (SOLVED)

Started by tilapisha, Tue 14/03/2023 11:31:37

Previous topic - Next topic

tilapisha

I know this is easy, and I've done it before, but I can't seem to find information on the manuals or forum.

I am trying to animate a character in room_AfterFadeIn(). This should work, but it doesn't.

Code: ags
function room_AfterFadeIn(){
    cObies.Animate(0, 5, eRepeat, eNoBlock);
}



Nahuel

Does your room have the Events correctly set?


Life isn't a game. Let's develop a life-like-game.

tilapisha

Ahhh, yes I always forget to set it in the Events properties panel as well. Thank you!

Crimson Wizard

We have similar case noted in a FAQ (https://adventuregamestudio.github.io/ags-manual/FAQ.html) in the manual, but apparently people still miss it. Probably because they focus on idea that particular command does not work correctly.

There's a common advice: if you just wrote a new function and commands inside do not seem to work, then the first thing to try is to place a breakpoint, or a Display command near and see if it executes. If not, that usually means that the whole function does not run, and that is a problem you need to solve.

Snarky

This is such a common mistake that I still think something like this would be a good idea. (Perhaps the best version would be a compiler warning whenever you have a function that matches a default event handler signature, but isn't linked to an event.)

Khris

Mostly unrelated, but remember that you should usually use the LockView command before animating.

SMF spam blocked by CleanTalk