Boat Wobble, How?

So i’m making a game with boats, However i want a realistic boat wobble effect.
And i want the character’s root to have the same CFrame as the boat.

https://gyazo.com/0ce4c74cb29274665d3ec63e5e13b48c

I’m not 100% sure how to make it, I assume tween to wobble the boat.

How would i make the character have the same CFrame as the boat?

1 Like

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.

3 Likes

Yeah, That works, Then i’ll just detect if a player is in the boat, And move their CFrame with the boat.

I’d also recommend checking out boat / ship oscillation. It’s a pretty interesting topic for realistic movement in water.

Ship oscillation? Do i find this on the DevForum or just google?

Nerbzzz why am I getting this result?

https://gyazo.com/95dfbf164a5eac331e9c3497e7e9b098

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.

1 Like

It would just be on Google. There’s a bit of math involved though. Even I don’t have my head wrapped around it well.

Oof, I’ll try to check it out to see if i understand anything at all.

Here you go, A very simple example.

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.

1 Like

Oh, That could make it look way better than it used to, I’ll give it a try tommorow! I’ll let you know if it works, Thanks!

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.

Alright, I’ll check it out right now, Thanks! :slight_smile: