Hi
I'm trying to control Music, Voice and Speech Volume in my Game.
The process
I have created a Menu that looks like this:
First of all, I have an animation with 10 frames.
Animation name is "Music_Volume_ANIM", inside "Music_Volume" scene object.
Each frame represents a volume status, from o (empty) to 11 (full).
So frame 1 represents volume 10, frame 2 is for volume 20 and so on.
The animation is set it to infinite loop and it is the default animation for the scene object.
The pause between frames is 100ms.
Then, as AFRLme suggested, I created a called by other action part.
local vol = getVolume(eMusicVolume)
if vol >= 0 and vol < 10 then
ActiveAnimations["Music_Volume_ANIM"].AnimationFirstFrame = 1
ActiveAnimations["Music_Volume_ANIM"].AnimationLastFrame = 1
elseif vol >= 10 and vol < 20 then
ActiveAnimations["Music_Volume_ANIM"].AnimationFirstFrame = 2
ActiveAnimations["Music_Volume_ANIM"].AnimationLastFrame = 2
...
end
The script contains all volumes from 0 to 100.
This script is an
execute a script action part inside of the first frame of the "Music_Volume_ANIM" animation.
This is where the script is called
The animation is the default animation, so it starts automatically:
--------------
The issue
When I test the scene, Music_Volume_ANIM loops, apparently ignoring the AnimationFirstFrame and AnimationLastFrame.
The log file is empty.
Any help is appreciated, thanks!