Now, after two months of developing my game using blueprints, I’m finding time and time again that some nodes don’t get processed immediately. Which first will break the blueprint logic, second, just makes me lose a lot of time figuring out why the stuff I know should work, doesn’t work.
Last wild node I’ve just found, and just spent one hour scratching my head trying to know why it doesn’t work, is the “Set Anim Instance Class”
So this pesky node will not complete in time till the next node will be processed.
Doing something like this will fail the cast and block the blueprint logic
But adding a delay node will result in a successful cast
There is no indications on what node will have this behavior. On the node description, there is no clue for the user that the node will not be completed immediately.
So there may be other nodes out there that have same behavior.
Anyway, using delays is not an option form me, one doesn’t know the player computer specs, maybe a delay of 0.2 is not enough on their machine. Did I put a delay of 10 seconds just to be sure it works? That will be stupid.
I’ve tried using “tick” to check if the variable I’m setting with that node is not null, then once it returns true, I’m setting a boolean to true, and then continue with the logic. This cumbersome. I need to keep track of all these booleans all over the place. Not fun.
Ideally there should be a node that waits till a task is complete then continue, like the delay above but instead of waiting for a set time, will wait till the previous node is finished. There are nodes that do exactly that, see bellow.
I’m really curios why this node behaves like this. I’m using nodes that have a clock icon, especially the async load nodes. both “async load asset” and “async load primary asset list” will block the blueprint execution on the line they are on and then resume when the load is completed. (which may take several frames or seconds)
Is “Set Anim Instance Class” bugged?
My question is what are the best practices to figure out when unreal has finished some task requested. There must be a practical and correct way to do this. I can’t imagine this happening just to me.
Edit: Now that I’m looking at the two last nodes, they have the Completed output, what about adding that to all these problematic nodes like the “Set Anim Instance Class”
Edit: I’ve fixed the example as there was a mistake in how the animation class was accessed. This is an example node structure just to isolate what I’m talking about. I have off course noticed and tested this in a complete working blueprint structure