#Walk me through Variables?

1 messages · Page 1 of 1 (latest)

wraith light
fathom widget
wraith light
#

Thank you! And this may be a silly question, but do the variables only apply to meshes? Or could I adjust the texture itself and create different eyes (for example) on different textures and swap through them with variables?

remote skiff
#

The closest thing to what you're asking that exists in Blockbench is using "preview.texture" in the Bedrock entity format. It works a little bit like a variable, but you cannot use instruction keyframes to modify it during an animation, you can only set it manually.

#

So for now, you'll have to create multiple geometries for the different eyes you want to have, and nest them in different groups. And use an animation to scale them all depending on a variable.

wraith light
#

okay! thank you so much!

abstract wasp
#

does thos variables work in game ?/bedrock i am just curious

remote skiff
# abstract wasp does thos variables work in game ?/bedrock i am just curious

You'll have to reproduce these variables on an entity client-side, they won't create themselves. If they are not initialized, Minecraft Bedrock will throw an error.
(https://bedrock.dev/docs/stable/Molang#Public Variables like variable.oink here, if you're not familiar. Checking out the Vanilla Resource Pack will give you plenty of examples too)

To modify the variables after they got initialized, you can use pre_animation (https://bedrock.dev/docs/stable/Molang#Entity Definition Scripts) to update variables every frame, or instruction keyframes in animations, or use the *on_entry *and *on_exit *properties of Animation Controllers.

remote skiff
#

!close