Animating idle view

Started by Aviva, Thu 19/07/2018 12:08:52

Previous topic - Next topic

Aviva

I am trying to make my idle view animted. I used the following code:

Code: ags
  cEgo.SetIdleView(2, 0);


In the view itself it works perfectly when I click on "Animate", but when I run the game, the idle view is stuck on the first frame.
Working on "Drained", a distopian RPG

Snarky

#1
Did you, by any chance, put this code in repeatedly_execute()? Don't do that: it means that every game loop it starts the animation again, so it never goes beyond the first frame.

Instead, put it in a function that gets called once when you want the idle view to be activated. For example on game start, or after the character has entered a certain room, or whatever is most appropriate.

Aviva

Thank you! Works like a charm on game_start :D
Working on "Drained", a distopian RPG

SMF spam blocked by CleanTalk