Help on making a boat sink (USING TWEENSERVICE)

So, I am trying to use TweenService to make a ship sink, and Ive been running into a few issues. I used this for reference: https://devforum.roblox.com/t/how-to-make-a-boat-sink/462664/9
I know that using a model work won’t as they don’t have Cframes, but in the link above, they were saying to use the primary part of the boat and weld it to the other parts. The only issue here is, this boat is made up of many little meshes and parts and unions, so I don’t really know what to set as the primary part as there isn’t anything really big enough to be a major part of the boat. If there any other methods to do this please let me know.
Thanks.

Models do have CFrames just in a different way. You can sink a ship my Tweening the Origin Position

And how would I access the origin position of a model?

Model["Origin Position"] = vector3.new(0,-5,0)

Im getting an error that says “Origin Position is not a valid member of model.”
Im using it like this:

local OriginPosition = Model["Origin Position"]

local Sink = TweenService:Create(OriginPosition, TweenSettings, EndGoal)
		Sink:Play()

and obviously I have the parameters set but not shown here but I’m getting an error.

I think you might want to check the TweenService API :D.

here’s a code snippet that might help.

local EndGoal = {
   CFrame = CFrame.new(0,0,0)
}

local Sink = TweenService:Create(YourModel.PrimaryPart, TweenSettings, EndGoal)
		Sink:Play()

`

Origin Position doesnt exist in the player. It only exists in studio.

@HanoPino you will have to use :PivotTo to move the model. most people create a cframe value, tween that, and have a GetPropertyChangedSignal on the cframe value to have it use :PivotTo on the cframe values current value.

it would be something like this

local value = Instance.new("CFrameValue") -- create the cframe value
value.Value = model:GetPivot() -- set the cframe value to the ships current position

-- tween the value, leaving this to you

value:GetPropertyChangedSignal("Value"):Connect(function()
    model:PivotTo(value.Value)
end) 

-- every time the tween updates the cframe value position, update the modeltoo

tween.Completed:Connect(function()
    value:Destroy() -- delete the value, we dont need it anymore
end)
2 Likes

Add a larger block that represents the ship’s mass, then Tween the part’s density property, and see if it realistically sinks when you tween weight onto it!

Hey, Im running into an error, the tween service is looking for a vector 3 value for the object value. So when I use frame it does not work. here is my code

local TweenSettings = TweenInfo.new(	--Ship Sinking Tween Parameters
			5, -- Seconds to sink
			Enum.EasingStyle.Quad, -- Easing Style
			Enum.EasingDirection.Out, -- Easing Direction
			0, -- Number of times tween repeats	
			false, --reverse	tween
			0
		) -- delay time
		local EndGoal = {CFrame = value.Value - CFrame.new(0,-10,0)}-- How far it sinks
		local Sink = TweenService:Create(value, TweenSettings, EndGoal)
		Sink:Play()

Thanks.

Nevermind, I figured it out myself.