Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Aviva on Thu 19/07/2018 12:08:52

Title: Animating idle view
Post by: Aviva on Thu 19/07/2018 12:08:52
I am trying to make my idle view animted. I used the following code:

Code (ags) Select
  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.
Title: Re: Animating idle view
Post by: Snarky on Thu 19/07/2018 12:41:07
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.
Title: Re: Animating idle view
Post by: Aviva on Thu 19/07/2018 13:21:11
Thank you! Works like a charm on game_start :D