Comparaison between two different vectors = 0.0 , why?

Hi everyone,

I’d like to calculate the velocity between two position of my motion controller (Vive motion controller). When I print the position, the value changes dynamically but when I try to store two positions and compare the difference between both, I get 0.0 value and I dont understand why.

Could you help me ? Thanks !!

NewVar0 is called all the time.

Event Tick by default is called every frame. Everytime the code is updated.

The first time it runs, a 0.1 second delay is started. Every further exec line (white line) into the “Delay” node will be ignored until the delay time has passed. Once it has passed it will execute the rest of the code.

By that time NewVar0 has already been updated several times to a new value.

While I’m not 100% sure about the following. If the distance is actually always exactly 0 that means delay is updated / checked every frame as well. Which means there are minor variations in how long the delay actually is depending on the amount of fps (60fps means one update every 0.016 seconds).

And apparently after “EventTick” has been called.

Anyway. The delay node for this type of behavior is a bad idea.

Depending on what exact type of behavior you need this might get rather complex. There is a velocity variable as part of the component. If you just need the velocity, use that one.