I have a seat that is welded to this Cube. The Cube has a BodyGyro, which means that it should only be staying in one rotation. However, when I go and sit on this rotated cube [it’s rotated 90 degrees left], it snaps to 0 degrees before eventually returning to 90. Why is this?
Thank you for something to test with.. always helps.
That is a stubborn little cube isn’t it, try this.
It will work when you sit down. I’m not sure after that, if you plan on this moving.
--ServerScript in ServerScriptService
local cube = workspace.Cube
local seat = cube.MovableRidableApplied
local gyro = cube.CubeGyro
gyro.MaxTorque = Vector3.new(math.huge, 0, math.huge)
gyro.P = 1e6
gyro.D = 1e5
local function lockRotation()
local look = cube.CFrame.LookVector
gyro.CFrame = CFrame.new(cube.Position, cube.Position + look)
end
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
if seat.Occupant then
lockRotation()
end
end)
I’ve actually ran into this before and never did come up with a solid fix. Clearly something going on here I don’t totally understand.
…same problem thats what i was saying
no matter how i position it or weld it, no matter how many properties or classes i change, the seat or vehicleseat will still suddenly snap to your orientation when you sit on it
here’s a .rbxm file if you wanna reproduce the issue
Sorry, I didn’t see the upload. This isn’t wrong; it’s too good. The movement starts as soon as you sit, and the camera takes a little bit to get in place. That is the movement you’re seeing from the cube.