Variables in Animation

Hi,

If I have a timeline animation in Studio, let’s say it’s a rotation. Is it possible to control the start and end rotation values from script?

What I’d like to do is set the end value of the animation randomly with every touch on the object but still see the set interpolation. I can set the rotation itself in the script but I’d like change the value in the animation.

Thanks,
Zsolt

Hi Zsolt,

You can’t set timeline keyframe values in script, however there is a workaround.

If you use the relativeToProp property (as mentioned in the Coordinate Systems article ) of the object you wish to move in a timeline then you can use a group who’s position scale or rotation can be set randomly in script.

Please see a simple example of this below and let me know if you have any questions.

randomMovement1.zpp (3.0 KB)

Thanks, Mark! Perfect!