I have a fairly complex object that is moved with SetActorLocationRotation every tick. When the function is called, it does it’s own collision detection again, which is a performance hit on our game. So my question is, can/should we try to figure out a way to not run collision detection immediately but instead wait for the “main” update? Or would that lead to stability issues?
hi !
When you say its own collision detection , what kind of evaluation are you making?
Box ? sphere ? linetrace ? complexCollisions ?
Beside optimizing this could be tricky
But you could try to use the default component for the characters or vehicles
that are surely “a bit optimized” from the start.
What kind of movement are you making to use a full-custom actor? do you really need it?
Also , check in everytick is not a sweet thing to do,
You may want to check the collision when your character move !
so not every tick
But again , if you start developing a complex char
you may end up in resolving a lot of things that are already resolved inside DefaultStuff
Well we’re making a sailing game where the boat’s collision consists of a bunch of box collision (still faster than one big complex). We’re essentially doing our own physics integration, partly because UE physics doesn’t play nice with hollow objects, but mostly because we needed bigger control over things than what the built-in system could provide. Because of this, we need to update fairly often to avoid stuttering (the tick is slowed down from the default to as small as we could go).
Profiling shows that when the SetActorLocationRotation is called with sweep, a collision detection cycle is ran, which due to the complexity of both the boat and the level itself is expensive.
So basically I was wondering if there was a way to kind of “delay” the sweep until the next collision detection cycle where all objects in the level get updated at the same time. Or is that not how Unreal works?
You could disable collision during the move…
And then what? Turn it back on after and then disable it before the next move?
We need collision on it otherwise it’ll go into the islands. We’re not on open sea.
if i remember correctly
the sweep collision detection happens only in the 1° object in the component list, the “Father” i dont know if something has changed from 4.27.
A bunch of box collisions ? look pretty expensive !
if i remember correctly the Spheres are a bit better of boxes.
but again , if you are making a game you have to simplify some stuff until they works.
Maybe you can move and rotate the Ship with no collision at all
and run a manual special collision detection just 1 frame every tot.
or simplify a lot your Bunch of boxes ?
I’ve tried to simplify the collision several times but due to the shape of the boat it’s either that or one complex collision. Issue is, since the player can stand and walk around the boat, it needs to have a blocking collision with the player pawn so it needs to always have collision turned on otherwise they fall through it.