- Code: Select all
if (ENERGY > 10)
{
ChangeAnimation("Event Actor", "LightdogRunRight", FORWARD);
CON -= 0.001;
xvelocity = 0.3*ENERGY;
ENERGY -= 0.0001;
}
if (ENERGY > 0 && ENERGY <= 10)
{
xvelocity = 2;
CON -= 0.001;
ENERGY -= 0.001;
}
I think you see what I'm trying to do. I'm trying to make the ENERGY variable go down slowly. This event is in the key down event of right arrow.
However, for some unknown reason the ENERGY ends very quickly. I've tried to add zeros in the line ENERGY -= 0.0001; and it always ends with the same speed. Then when I add enough zeros it stops declining. Is this a bug or why there is this kind of behaviour? The motion compression is off.
