Forcing part to stay upright

I’m trying to force a part to stay upright whilst manipulating its physics to thrust forward using BodyForce, the part moves on its own using this method and I can’t really use BodyForce on anchored objects why?

game:GetService('RunService').Stepped:Connect(function()
   object.Orientation = object.Orientation * Vector3.new(0, 1, 0)
end)
3 Likes

Wouldn’t that script just force the part to not have any rotations on the X and Z axis, only allowing to be rotated on the Y axis? As to why you can’t use BodyForce on anchored objects, it’s because BodyForce applies to physics, and physics are disabled if the part is anchored.

1 Like

Yeah, that’s I said, I basically want this part to stay like this forever, and I figured why BF doesn’t work, I decided to opt in for TweenService but I’m not exactly sure.
image

1 Like

Here’s how I think you could do it:

local originalRotation = object.CFrame.Rotation
game:GetService('RunService').Stepped:Connect(function()
   object.CFrame = CFrame.new(object.Position) * originalRotation
end)

This would make it set the object to it’s original rotation every Stepped.

It still moves on its own and very shaky.

Could you try using Heartbeat instead since it runs after physics?

Use AlignOrientation to keep it upright.
If it still moves then you’ve got an issue with your direction script.

1 Like

AlignOrientation worked! Here are the properties I used!
image

5 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.