Player doesn't get knocked by rotating part

Hi! I’m currently working on a game in which I want this sweeper to knock people off, but when I rotate it too fast it doesn’t actually knock the player off but instead the player kind of glitches thru it.
See the attached video to see what I’m talking about. You can see that the player doesn’t get knocked off, but when the sweeper slows down the player does get knocked off…

Does anyone know how I can fix this issue without having to slow down the sweeper? I’m currently using a script in which I just rotate the sweeper every wait()

Try make that if person touches this part, this happens: ...Humanoid.Sit = true

Making this game R6 will impact too

Humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)

Make sure “Humanoid” is correctly referenced with whatever variable you’ve declared for it, place the line of code wherever a player being hit by the red beam is handled.

I’ve tried that, but it looks very unrealistic and still a bit glitchy. The player falls after the sweeper is like 2 platforms further or something…

1 Like

Hmm I did get that to work but sometimes the Humanoid’s state switches back to normal too quickly, before the player has fallen off… Do you know how I can make some sort of cooldown for it?

https://developer.roblox.com/en-us/api-reference/function/Humanoid/SetStateEnabled
You could try disabling the other humanoid states until the player dies?

Alternatively you could apply force to the player to ensure they fall off.

My hunch is that you are rotating the sweeper by updating it’s position and rotation. If it hits a player like this, the game wont launch the player because the part technically still has 0 velocity. You might have a bit more success if you use constraints to rotate the part, but if that causes too many physics problems, you could resort to manually adding a bounce script that pushes the player on touch.

Thank you very much for the suggestion! I used constraints with a motor to make it rotate, which works way better and the player actually also gets knocked with higher speeds now. Thank you very much! :smiley: