The messsage still appears though even if the array is empty. It does go away when I break the link from “GET” to Select Vector (just to make sure the message doesn’t come from an entirely different place). So I’m wondering how is that possible? Is it normal behaviour that both values of a “Select” are calculated no matter the condition? Or am I just not thinking straight?
yes, you are right. blueprint will try to put as much stuff in one go instead of making them multiple instructions.
So you need to check if your length > 0 with a branch node and then decide what to do next.
Having real trouble getting this to work any other way. I’ve skimmed over my other blueprints and it’s a bit scary to know that the Select nodes evaluate all cases all the time. This is so counter to what we’re used to in programming and sounds horrible for performance. It’s the first thing in blueprints that makes me want to go writing code instead. Surely there is a technically sound reason for this, but still.
I put steps in place that don’t work What’s happening is that LastIndex returns -1 because the array is empty and then the BP is trying to access array-1] because of this odd behaviour. Granted, the array can never be null but it’s still ugly anyway especially since that stuff runs per Tick whenever the player is moving.
Thought about putting a “bumper” item into the array too. It would work, what an ugly hack though. Guess I’ll end up doing that.