How would i tween a tsunami?

So im trying to tween a tsunami so that it starts out like maybe 5 studs away from the player and then like moves forward maybe 10 studs in the direction the player is looking in. How would i go about in doing this?

2 Likes

Check out Skinned MeshParts are live!

I think they are most helpful in your situation

You can use CFrame.LookVector to find the direction of their HRP, then clone the tsunami model from wherever you stored it, set its CFrame to 5 studs ahead of the HRP, and tween it 10 studs ahead

I don’t see how that is of any help in this situation

1 Like

I still don’t see how that is going to help at all. Maybe for visuals, sure, but OP is obviously asking how to spawn a tsunami and make it move forward, not creating a realistic wave

2 Likes

I’m not really sure how to tween, can you show me?

a tween is basically just an animation that you can create for an instance, like a part or a gui. You can change its starting and ending properties such as size and color, and the service will do the animation job for you.
You can create a tween using TweenService:Create(instance, info, goal), which requires 3 arguments to be passed, the instance to be tweened, the tween info (which is basically settings and customizations for the tween), and the goal position

put this in a script and see it for yourself

local TS = game:GetService("TweenService")

local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Parent = workspace

local tween = TS:Create(part, TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.Out, -1, true), {Position = Vector3.new(5, 20, 5), Size = Vector3.new(10, 10, 10)})
tween:Play()

It’s easy really. If you’re a beginner, this’ll help make it more easily comprehensible but uses up lines and can cause a clutter further down the line:

TweenService = game:GetService("TweenService") -- Import the Tween Service

Info = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut) -- Tween Info

Move = TweenService:Create([Part, ex: script.Parent], Info, {Position = [XYZ]}) -- Tweening
-- TweenService Complete

Move:Play() -- Run the tween you just made

or, a more compact way of doing the same thing;

game:GetService("TweenService"):create([Part], TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut), {Position = [XYZ]}):Play()

…and you should have a working tween! (Some assembly required)

Let’s explain what is going on, shall we?


game:GetService("TweenService") fetches the service required to run tweens! Without it, you’re going nowhere.


TweenInfo.new([Time], [EasingStyle], [EasingDirection]) is the required information for what you’re planning to tween, basically it’s configuration. You start with [Time], how many seconds you’re going to run the tween.
Then comes [EasingStyle], there’s many styles such as quad, quart, linear, exponential and many more. I suggest experimenting and having fun with these, each options produce substantially different results!

And lastly, [EasingDirection]. It’s quite self explanatory once you get the ropes of tweening but there are 3 choices. In, Out and InOut. Think of it like this… In accelerates from no movement. Out starts at max speed and decelerates as it reaches the end of the tween. And InOut is the combination of both!


TweenService:create([Part], TweenInfo.new([Time], [EasingStyle], [EasingDirection]), {[Property]}) and the pièce de résistance. The tween! Let’s break it down.

[Part] is the part you’re applying the tween to.

And {[Property]} is the property you’re tweening. If it exists in the properties panel, you can tween it.
Pro Tip: You can tween more than 1 property at a time.


That should be it!
Tweening is one of the best tools to learn for roblox since it makes animations way smoother than possible with loops and easier to make. A must-know!

Good luck developer.

I’m kind of confused on the lookvector part, where will that go

this was helpful but what about the lookvector stuff

How did you make it, so the boat moves with the waves? And is that the roblox water, or a modified version of water?

Well, I’ll be honest with you, I’m not the best scripter out there, if anything you can call me a rookie really. I can only tell you which and/or how you could solve your problem but I can’t script it for you and give you a finishing product really.

With that out of the way, you can try the following; Get the player’s position, clone the tsunami model from ServerStorage to Workspace, use the player’s position and add an offset to one of the 3 axies and plug that in the tsunami model’s position and have the tween script run as soon as spawning the tsunami (Tweening Script preferably in the tsunami model). Of course you can spice it up with lookvector however I personally don’t work with that so I can’t help you with it.

1 Like