I have some complicated logic that needs to be fired every ~0.05s, so I try to optimize it. The logic is needed only when actor changes location - what’s the better way to check if actor is moving?
1. Get Velocity -> Get Vector Length -> check if it’s greater than 0
2. Check if GetActorLocation == previousLocation. If not, it means that actor has moved, then set previousLocation to GetActorLocation
Which one will be faster? I know that the first solution can miss some location changes (rarely, if actor would move and stop within this ~0.05s. period - and it’s not a big deal in my case), but mostly I’m curious about speed.