if you have a primarypart for the boat model, you can do something like this:
local boat --Change this to your boat model
while wait(5) do
local rotation = math.random(-10,10)
local amount = 0
repeat
if rotation < 0 then
boat.PrimaryPart.Rotation = boat.PrimaryPart.Rotation - Vector3.new(0, 1, 0) --Im not sure which to change (Im not on roblox studio atm).
amount -= 1
else
boat.PrimaryPart.Rotation = boat.PrimaryPart.Rotation + Vector3.new(0, 1, 0)
amount += 1
end
until amount == rotation
end
Edit: I have found an error in my script and have fixed it. I only ADDED to the amount when im supposed to subtract OR add depending on the rotation. That also explains why @FamousRemusX was having his problem.
The script he put it in is a bit weird imo, Instead you should use tweenservice, And tween the boat’s CFrame, I’ll DM you the script once i get it working.
local TweenService = game:GetService("TweenService")
while wait(5) do
local TweeningInfo = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.In)
local TweenRight = TweenService:Create(script.Parent.PrimaryPart,TweeningInfo,{Orientation = Vector3.new(0,0,10)})
local TweenLeft = TweenService:Create(script.Parent.PrimaryPart,TweeningInfo,{Orientation = Vector3.new(0,0,-10)})
TweenRight:Play()
end
This rotates the part with a nice animation, Hope it helps!
Sorry for the late reply lol you posted this just when I was in USMC Boot camp lol. If you haven’t already figured it out, I have made a brick that is compatible with the animation editor on ROBLOX. If you make an animation with a easing style of cubic and easing direction of InOut, and you set the key frames to where you want the brick to be in terms of orientation, it should give you a nice animation. Then you can weld your boat to the brick so the boat will move with the brick and set the brick’s transparency to 1 giving your boat a realistic bobbing and bouyancy effect. The best part is that you make the entire animation with the animation editor so you are more in control of how you want it to be. Let me know if you need clarification.
Yeah so I created an asset that you can use to make that happen it should be one of my more recent creations so you can look in my inventory and take a copy for yourself.