I have a breakpoint in an event where I’m trying to get an integer value (Cargo capacity). I pass in a component with the Cargo Capacity variable in it set to 50. The variable is not instance editable and is never set anywhere in the blueprint or any other blueprint - it’s just a constant in the component. I get the cargo capacity variable in the event after passing it in and the variable is suddenly 0. You can see from the screenshots that in the same frame it appears to have 2 different values.
What is going on here? I’m completely stumped and don’t even have an idea how to troubleshoot this.
Also, the second variable cargo capacity (which is set to zero for testing purpose) is not setting the components cargo variable to 0 ( if that was the intention or something ).
Seeing as your screenshots seem to all be taken from the moment of the breakpoint triggering on the last node, I’d say the variable value displayed on that last hover tooltip (where it says Cargo Capacity 0) is probably fake. The variable isn’t used for the node your breakpoint is on so there’s AFAIK no guarantee that it’ll remain properly cached, and I wouldn’t rely on the tooltip info as factual.
When in doubt just add some temporary Prints, they’ll always print the correct value.
The problem is that once it’s passed into that drop cargo function, the input Cargo Capacity In is 0 and the function fails. So it’s both 50 (for the branch that reads as true) and 0 (for the input node)
I figured out the issue by trial and error. I didn’t know this was the case, but when inputting a converted float into an operator, it has to be stored inside a correctly typed variable - the type conversion node can’t be used directly with an operator - but it can be used with a condition apparently. So because of the issue with the operator the variable was being treated as both 0 and 50 depending on which node took it in. I don’t know why this convention is the case, but temporarily storing the variable before doing multiplication worked.