It’s not really a Bezier curve, more of a decreasing orbit.
You could calculate the sphere’s orbiting CFrame, and then decrease the radius in the calculation.
Okay, this is very tacky, but this is what I have so far.
How do I make it start from the character I kill and then go to the loop around me?
Right now It just spawns around me and loops till distance is 0, but I want it to come from the player I kill.
local XPEffect = script.trail:Clone()
XPEffect.Parent = workspace.Junk
XPEffect.CFrame = targetRoot.CFrame
local i = 0
local Speed = 0.15
local Distance = 20
local stop = false
task.spawn(function()
for i = 1, 200 do
Distance = Distance - 0.1
task.wait(.05)
end
end)
while true do
if stop == true then
break
end
task.wait()
i = i + 1
XPEffect.CFrame = character.HumanoidRootPart.CFrame * CFrame.fromEulerAnglesXYZ(0, i * Speed, 0) * CFrame.new(0, 0, Distance)
if Distance <= 0 then
stop = true
end
end
game.Debris:AddItem(XPEffect, .1)
the sphere came off the sky and went into the player in a spiral form and making a circle is sin(t), cos(t) and the circle is not from a rotation, its a position
rotating a sphere does not do anything
local RunService = game:GetService("RunService")
local XPEffect = script.trail:Clone()
XPEffect.Parent = workspace.Junk
XPEffect.CFrame = targetRoot.CFrame
local Speed = 7
local Distance = 20
local t = 0
function lerp(a, b, t)
return a + (b - a) * t
end
while true do
t = t + RunService.RenderStepped:Wait()
local far = lerp(Distance, 0, t / Speed)
XPEffect.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(
math.cos(t * Speed) * far,
far,
math.sin(t * Speed) * far
)
if t >= Speed then
break
end
end
game.Debris:AddItem(XPEffect, .1)
Start the sphere at the other player’s location and spiral it from that point.
You could get the distance from the opponent’s Position to your character and use a formula to calculate the spiral’s trajectory.