# How to make this EXP float effect?

Hey! So I saw this EXP Orb effect where the EXP part floats to the player in kind of a circle, and I was wondering how I can recreate this effect.

Obviously it’s a sphere with a trail, but I am wondering how to do the movement.

Any help would be deeply appreciated, as I have thought about this for quite a minute.
I thought bezier curves but I do not know.

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

for i = 1, 200 do
Distance = Distance - 0.1

end
end)

while true do
if stop == true then
break
end

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

``````
1 Like

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