Sweep doesn't work on AddRelativeRotation?

I’m getting very inconsistent behavior with “Sweep” movements.

With a sliding door, if I move it repeatedly with AddRelativeLocation with Sweep=True, door stops when it hits an obstacle. This is great.

With a rotating door, if I move it repeatedly with AddRelativeRotation with Sweep=True, door passes through all obstacles. This is not great.

StaticMeshComponent that I’m moving has good collision volumes, has collisions turned on, and in all other ways seems capable of blocking or being-blocked. I can make it collide with static or dynamic objects (or both) by tweaking its collision settings, and that all seems to work fine for most things. But when motion is rotation, Sweep seems to do nothing.

Is this a known issue? Thanks!

1 Like

For record, this bug is easy to reproduce:

  1. Create a new “First Person Blueprint” project in UE4.4.1, and use Example_Map level.
  2. Delete several physics-objects blocks in Example_Map, to avoid confusion.
  3. Create a new Blueprint, derived from Actor, called “MovingBlock”
  4. In that Blueprint, add a StaticMeshComponent called Block. Set Block’s StaticMesh to Shape_Cube asset, set its Collision Presets to “BlockAll”.
  5. In that Blueprint’s EventGraph, add an EventTick which calls AddRelativeLocation (Target=Block, [X=10, Y=0, Z=0], Sweep=True). This will make it slide in +X direction continuously.
  6. Drop an instance of that blueprint into middle of ExampleMap arena.
  7. Hit Simulate, and watch how block slides and then stops when it hits a wall. This is “good” behavior.
  8. Now modify EventGraph so that EventTick instead calls AddRelativeRotation(Target=Block, ([R=0, P=0, Y=1], Sweep=True). This will make it Yaw (rotate around Z axis) continuously.
  9. Move Blueprint instance so it’s next to (but not touching) one of Example_Map walls.
  10. Hit Simulate, and watch how block rotates through wall. This is “bad” behavior.

Why does Sweep cause AddRelativeLocation to stop on collision, but not AddRelativeRotation?

Thanks!

I have reproduced this bug in 4.3.1 as well.

Hey tlokovic,

Thanks for thorough investigation! I was able to reproduce issue you described, and have entered a report in our database for our developers (TTP# 346402). I will let you know when I see an update on this. Thanks!

Looks very much like issue i have on my project…

Oh and ‘Set actor Location’ has a Sweep option, whereas ‘Set Actor Rotation’ doesn’t. Kind of suggesting Sweep on rotation is not supported?

Hi Genova,

Unfortunately you are correct: rotational sweeping isn’t supported. bug report (UE-3158) was closed because developers aren’t able to fix this with current collision/physics system. I’m going to see if they can at least remove Sweep option from node as it clearly doesn’t belong there.

Hey ,

What a shame, for a moment I thought you guys would fix/support this, and that would have solved all coll issues I’ve been struggling with for several weeks :wink:

Out of curiosity, would you be so kind as to ask for an explanation on why it wouldn’t be supported ?
Thanks

Sweeping shapes is a pretty well understood problem and there are good analytic solutions to it, but (as far as I know!) that just isn’t case for rotation. only approaches I know of involve something like binary searching, or using some more complex geometries like Plucker co-ordinates, but even then it is very complex and thus slow. If you find an approach that seems practice do let us know though!

Very unlikely, I only have a Designer background :slight_smile:
Thanks for info though.

A found this page because I also expected sweep pin to be functional in AddActor(World/Local)Rotation. Could that be fixed?

Maybe with a hover-on comment that says sweeping is not supported?

I just want to point out that in October of 2019, Sweep option that is not supported is still on node.

1 Like

only approaches I know of involve something like binary searching PayGoOnline, or using some more complex geometries like Plucker co-ordinates, but even then it is very complex and thus slow.

October 2020, sweep option is still on node and doesn’t work :frowning:
Does anybody find a good solution for this problem?

IDK - you could try jiggling it a tiny bit each time it rotates, using a SetActorLocation node, with sweep added, to force it to collide. Not sure if that works though.

I’m currently working on a custom movement system that runs up against this issue. There are ways around it, but cost starts to become a concern. I’m curious how this type of thing is handled on objects simulating physics, which are bound to collide from rotations. Do they just enter from a rotation then depenetrate up to a max iteration?

Is this problem still intact in UE5.3 as of 2023?
I was trying to see if it would work since that node has Pin, but it doesn’t seem to work.