didn't work for me either.
But after trying a few ways, i found that if you initialize the angle or the directional_velocity variables before calling the function angular_movement defined in global code it works.
by adding
- Code: Select all
angle=0;
or
- Code: Select all
directional_velocity=0;
before the function call, it will work.
attached is a .ged that shows 3 actors
1 actor initializing the angle before the function call (works).
1 actor initializing the directional_velocity before the function call (works).
1 actor just calling the function without initializing any of the variables first(doesn't work).
By the way, the below .ged has defined double for angle and double for speed, it works, it seems to be an initialization problem or maybe how GE optimizes code maybe? (like checking to see if the variables are initialized at all before it even tries to even animate your player? not sure. but hopefully it'll get rid of some frustrations for beginners like myself.