Can you change an actor's location, instantly?

I’ve noticed that “Set Actor Location” node actually moves the actor to the new position, because if I do that in a function and then I try to get the actor’s location, it’s still at its initial location.

So, is there a way to relocate an actor instantly?

Hey @AllGamesSuck!

So the way that programming sequence works, technically it all happens at the same time. It’s a weird concept. But more or less, you can’t move them and get the location as until THAT TICK IS OVER, THEY ARE STILL AT THE OLD LOCATION and yeah, it’s bizarre, but it’s how CPUs work. You need to either:

Pass the location you’re inputting for “Set Actor Location” to the output you’re wanting
OR
Wait and get the actor’s location on the next tick.

Hope that helps! If you show some of the code maybe we can think of a way to get you what you’re going for… :slight_smile:

1 Like

maybe nitpicky but i think it might be due to how ue works more than the cpu itself. ue renders a few frames at the same time. it has to solve physics which are in another stage. and has batched/concurrent ticks. and networking. so maybe it keeps the current location to keep a consistent world state and avoid race conditions, so that then the state can be changed in the same instant, next frame, that “it all happens at the same time” like you say. so all in all, maybe that’s the best approach. i’m not sure, just guessing.

good advice anyways :+1:

1 Like