How To check if all actors have a null speed and return bool

Who sets the variable? Or is the variable just created by you? Actors must first be found using “GetAllActorsOfClass”. Otherwise the game does not know which one to address.
If you want the speed of the actor, you have to use GetVelocity instead of GetComponentVelocity.

Hello,
I need to check in the world if all my cube have a null velocity and return a bool. I try like this but it doesn’t work!

Do you have physics enabled on those cubes?
If so you should use GetVelocity, with the actor as input param. The GetComponentVelocity returns the component’s relative velocity to its parent. Which is 0 if it’s a root component.

Thanks for the answer, in fact i initialized all in the construction script to store all my BP_Cube in the array.
I think the problem is that if one of the value is equal to zero, it returns true. I need to set something like : If all the values of the array is equal to zero so the boolean become true. I precise that i use a check event every 2 seconds to see if all my cube have a speed of 0.

Construction script is not the place to do that, you should get your Cubes in BeginPlay
They are only instantiated then

The return node cancels out the rest of the for each, basically you only checked the first element and got out of the for each, do a branch node and only return true if velocity = 0 otherwise continue the loop and add a return false at the end of the for each (completed)

Finally it works! But it was a hard work^^