Ideally, this could be done on the server, I’d like to do it with body movers, but in order to do that I need a given Vector3 of the angular velocity which makes it really tricky to combine postion+velocity into the correction rotational velocity. The further the hit is away from the center of mass, the more it should rotate
In this case v is the velocity of the bullet, and r is the position where the bullet hit, relative to the block’s position. Because of the cross product being involved, the angular velocity vector would be perpendicular to both the position and velocity. For example if it hits horizontally, the block should only rotate around the Y axis as a result.
I was explaining how to acquire the angular velocity from input vectors, obviously I would recommend using an AngularVelocity constraint instead of manually setting the velocity of parts.
Your math works but it has the same issue I was facing to begin with. You can’t put most of the new constraints inside humanoids (owned by a real player). The dummies work perfectly but the players don’t because I’m guessing theres something inside the player module that corrects the orientation
Dang that actually works really well. The only thing that doesn’t work now is mouse lock forcing the orientation, how exactly do you think I should fix that?
The server isn’t setting your orientation. Since the network ownership fix, the server is telling you to fling yourself if you get hit by a bullet.
You could fix the orientation problem by manually changing the camera orientation when you get hit by a bullet. Or making it follow the player head for 1 step while your character gets deflected by the bullet.