Creating keyframe by adding user value

I’m trying to create an automation for constant speed on position X, and base the change on a number entered by the user. I can get the first keyframe with no issue, but can’t seem to get the second keyframe to change its value. What am I doing wrong?
constant speed - X.json (12.1 KB)

Hi @skimber,
nice work! you have 2 minor problems that one of them is on me.

#1 issue -
You had no value in the number variable called “variable8”, and variable with no value will mess up the automation after using it, so this variable stops the automation after trying to use it in the action line (you can add message lines between the problematic lines and check what is the last message that function properly).
setting the value to 0 will solve this problem.

This issue can be solved by me with an easy update to make a number variable defaults to 0 instead of nothing and I will do it.

#2 issue -
You tried to set the “posX” - “value” property to a new value for the second keyframe and then add the keyframe.
the value property will not change once the property contain keyframes (and in this step it contains the first key), so line 10(in your version) won’t affect anything. you can read this in the tooltip of the value property.
instead calculate the new number for the second keyframe on a number variable and use this variable in the “add key” action.

this is a working example with these fixes -
Download -
constant speed - X v2.json (12.8 KB)

Thanks,
Alon

Ah, good to know! Thank you! :slight_smile: