SetActorLocationAndRotation performance issue


I have not so much different actors on my scene (for now), which I update once a tick.

My target is mobile platform, so every ms lag on PC produces up to 10X lag on mobile device.

Actually I experience on 24 individual actors with SetActorLocationAndRotation:

  • ~120 μs (0.00012 seconds) lag on PC, Intel i5-2500 3.3 GHz
  • ~1.2 ms (0.0012 seconds) lag on Sony Xperia Z1, Qualcomm Snapdragon 800 2.2 GHz

The joke is that this lag is 1/3 on PC and 1/4 on mobile of all my own physics simulation I have processing with thousands of calculations. I need stable 50+ fps, but I have only 16 ms of time frame, which is devided by half I suppose for rendering purposes on mobile device.

So I’m asking: is there more optimized way to position and rotate actors (mesh components). Something like direct change of transformation matrix. Rotation by itself is getting from FMatrix (its calculation doesn’t lag).

I see that SetActorLocationXXX methods use RootComponent->MoveComponent(...) instead of setting position directly and I am at a loss with that fact.

Thanks for any advice!