So I have a VehicleSeat and when you press W, it rotates forward, and when you press S, it rotates backwards. However, it’s rotating using global space rather than object space, so if I change the orientation of the seat, it rotates the same way every time, regardless of the orientation. I’m trying to make it so it rotates forward in the direction where the VehicleSeat is facing.
The issue isn’t the method of which the CFrame is being set. Changing to TweenService wouldn’t solve the issue, because the CFrame would still be modified in world space.
I’m trying to have a crack at this issue but I hate CFrames and can’t quite figure it out. I’m trying to implement CFrame:ToObjectSpace in my code, though I don’t think I’m using it properly.
BodyGyro.CFrame = CFrame:ToObjectSpace(BodyGyro.CFrame) * CFrame.Angles(math.pi/6, 0, 0)
-- It looked something like this. Can't remember what my repro looked like.
What this basically does is convert the BodyGyro.CFrame to a CFrame relative to the Part, using :ToObjectSpace(), and then applies the rotation.
Hopefully this should work