If you create a variable in an animation and then refer to it, a false error about an unknown variable is generated in the log.
Steps to Reproduce:
Create an Animation Controller that uses a Molang variable.
Create a second Animation Controller that references the created variable.
Connect Animation Controllers to Players.
Observed Results:
When connecting to the world, an error appears in the logs (Error: unhandled request for an unknown variable ...). However, it's important to note that this error does not affect the functionality of the code, and it still works correctly.
Expected Results:
The error should not appear since the variable exists.
Example Code:
[media]Attachments
Comments 7
Since you are using the outdated 1.10 format version, transitions in the default state occur before on_entry
, a bug which is preserved in that format version for backwards compatibility. Therefore, the message is correct, since the variable is checked in link
's transition before var
's entry runs. The fix is to use the latest format version
The issue persists even after updating the animation_controller to the latest version, specifically concerning a false error indicating the non-existence of a variable. However, the problem arises only when variables are accessed before their creation.
For instance, with two animation_controllers: the first one checks a variable for equality to any value, and the second one creates a variable under a certain condition. If the condition in the second animation_controller is met, the variable is created, and the first animation_controller successfully detects its existence, returning true.
Nevertheless, despite this workaround, the error continues to manifest, likely due to peculiarities in the update process.
Yes, accessing variables before their creation is the express cause of and purpose for this error. You can use the syntax "v.whatever ?? 0
" to select a fallback value instead, if circumstance prevents you from properly initializing the variable
Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response
Could you please provide more details or/and media files. As such we have no repro of this issue.
Also, just a reminder, to make your bug report as effective as possible, please try and include the following steps to reproduce the problem:
Steps to Reproduce:
1.
2.
3.
Observed Results:
(Briefly describe what happens)
Expected Results:
(Briefly describe what should happen)
If your ticket does not look like the example given here, then it's likely to be closed as incomplete.
This ticket will automatically reopen when you reply.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki