Best way to make a spinning sweeper arm that affects non-anchored parts?

I tried CFrame, which resulted in the sweeper arm clipping through the unanchored parts. I also tried BodyAngularVelocity and BodyPosition, but when a ball rolls into it, it knocks the arm back.

You could try to use an AlignOrientation object with RigidityEnabled.

Isn’t this for attachments only?

You would put an attachment at the center of your part you wish to rotate, and the other one to wherever you want to align it to. You could then rotate it by simply rotating one of the attachments CFrame.

This would differ from directly rotating the beam’s CFrame because it would not ignore collision.

I don’t think I understand what you mean. I tried to do as you said, but nothings happening.

Take a look at this place.

Rotating Beam.rbxl (14.9 KB)

This isn’t necessarily the best method of achieving this, it was just an idea.

2 Likes

HingeConstraints have a motor option. You can set torque very high so colliding objects don’t push the arm back.

The arm must be unachored as constraints require physics.

https://developer.roblox.com/api-reference/class/HingeConstraint

I suggest using Hinge constraints and weld constraints. I’ve been using them and they are way better than CFrame. Use the weld constraints to weld all the parts that are spinning together, so in this case the truss, sweeper bar, and so on (Make sure the sweeper is unanchored). Add a hinge constraint to the bottom of the sweeper that will be the spinning point, and the part below it that Is the anchored part making the whole sweeper spin. If you need help reply back. Also, for hinge constraint make sure motor max torque is infinite, motor max acceleration is infinite, and the angular velocity is the speed. Also for the angular velocity don’t forget that it can spin both ways, meaning the speed can be 1 and spin towards you, or -1 and it will spin the opposite direction.

also use this HingeConstraint | Documentation - Roblox Creator Hub
and I forgot to tell you, actuator type = motor