Hello!
I’ve been wanting to implement a Volcano Eruption into my game, but i’ve hit a dead end on how to animate it.
I’ve tried using math.cos(x)
but i’ve had some very weird results with it, i might be using it wrong.
I would like to know if anyone knows how to do something like this:
Imagine the green part is the volcano’s debris (or wth the name is) coming out of the Volcano.
Now i could use something like BodyVelocity but i think it might be weird to work with since i want these Debris to go into specific positions that could change when the Volcano erupts.
Here is a snippet of what i tried doing (It’s very bad code, but i was just testing lol):
local TweenS = game:GetService("TweenService");
local Alpha= 0
local B = workspace.B
local A = workspace.A;
local Duration = 4
task.wait(7)
local a
a = game["Run Service"].Heartbeat:Connect(function(deltaTime)
Alpha = math.min(Alpha + deltaTime / Duration, 0.4);
B.Position = B.Position:Lerp(A.Position + Vector3.new(0, math.cos(Alpha * 3.14) * 80, 0), Alpha);
print(Alpha)
if Alpha == 0.4 then
a:Disconnect()
print("a")
end
end)