#Listing multiple values for anim time update
13 messages · Page 1 of 1 (latest)
Please make sure to read #1029468016594911232 as it may answer your question!
Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.
There's only one return value, but you can assign variables and calculate other stuff before:
variable.test = 2 + Math.random(2, 4);
return query.anim_time + variable.test;
I'm not quite sure what you mean..
What's your end goal?
Do you mean to use custom variables on your entity to play different animations at different paces, rather than the default "q.anim_time + q.delta_time" in anim_time_update?
It was to only update a variable (to a random value), under a certain boolean state (I had an expression for this, that only seemed to work in blockbench not mc).
So you wanted a variable A to be set to a random value every frame, so long as another variable, query or property B returns true, to use variable A in an animation?
The things you write in the Variable placeholder tab of Blockbench are not going to automatically be setup in an entity file. You need to remake them, if you didn't know https://wiki.bedrock.dev/entities/entity-intro-rp.html#scripts
I didn't have them as variable Placeholders, I had them under anim time
I see
I can't tell if you're a beginner with MC Bedrock or an advanced user, what would be the point of setting variables from there?
And as Jannis wrote, you have to use semicolons to separate the expressions https://bedrock.dev/docs/stable/Molang#Simple vs Complex Expressions
Ik that 'complex expressions' (expressions that contain '=' or ';') must end with ';'
I'm trying to do it from there for a few reasons, the main one being that it's just inside blockbench, and I'm not 100% familiar with how pre-animation variables in the client entity works
Ok, then you should learn how variables are defined in Bedrock entities, it's 10000x simpler than what you're attempting, and is the intended format. Animation Controllers and learning how "initialize" and "pre_animation" work is the way to go.