Setting linear velocity of a rigid body in incredibly expensive

I’m setting linear velocity of a rigid body, but when I do so my framerate drops in half.

Weirdly I can set linear velocity of several and effect is only really as bad as setting one.

Is there some re-initialisation that happens every time linear velocity of something is set?

I don’t have problem with angular velocity as you can limit it per object with a one-time function call, but for linear I need to get, clamp and set per frame as there is no per-object setting (that I’m aware of) for max linear velocity.

I’m putting this as a bug as I’d imagine that firing that function shouldn’t have such a hit on framerate.

I’m running on PS4.

Hi

Is this only happening on PS4, or does it happen in editor as well?

Just checked, happens in editor too, drops from ~400 to ~90

Interestingly it drops framerate for around a second after velocity is set, not just on frame you set it

Hi

I attempted to reproduce this but I couldn’t get your results. I didn’t experience a FPS drop. Could you post a screenshot or a test project showing how you are applying velocity?

I’m out of office until next year now. I managed to work around problem to a degree but I’ll try to get an isolated repro in a project when I get back

Hey

Thanks for heads up. I’m going to resolve this issue for tracking purposes but once you get back in office, just post a comment here to reopen post.

Cheers,

TJ