This is more of a question than a “help” thread. So I’m trying to move a boat model in circles around a fixed center point, and was wondering if anyone had any suggestions on how to do that?
I’ve tried to do something along the lines of of this:
local model = script.Parent
while wait() do
model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.new(0,0,0 +.1))
end
The problem with that is that it’s not really rotationg around a fixed position, and the player doesn’t move along with it. I’d like the player to be able to stand in the boat, and move in the same direction as it.
Update:
Kind of works now, but can anything be done to prevent the player from sliding off?
local Boat = script.Parent.Objects.Boat1
local Center = script.Parent.Objects.Center
local hingePos = Center.Position
while true do
for i = 1, 360 do
Boat:SetPrimaryPartCFrame(CFrame.new(hingePos) * CFrame.Angles(0,math.rad(i),math.rad(90)) * CFrame.new(0,0,-137))
wait()
end
end
The code you’re using sets the cframe of the model, this means that the model is instantly at the new position so there is no force to act on the character.
If you want to have it interact with the player/physics then I suggest that you use a BodyMover or a Constraint.
The simplest solution will most likely be to have an attachment[A] in the model’s primary part, and another[B] at the position you want to rotate around. Then use an AlignOrientation to connect them. Change the rotation of [B] and the model with rotate towards it, and the character will respond to the forces.