That is true, I would instead use Roblox forces then.
Moving the part with a force towards the player,
depending on your settings ofcourse the orb can overshoot and miss the player,
but still wanting to go towards the player. Giving you that Back EasingStyle but in a way
cooler way if you ask me.
I’ve generated this code with ChatGPT,
and you should definitely ask ChatGPT for this simple task in generating a working code for the force stuff.
Best of luck!
local part = script.Parent
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local target = character:WaitForChild("HumanoidRootPart")
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.MaxForce = Vector3.new(4000, 4000, 4000) -- Adjust for stronger or weaker force
bodyVelocity.Velocity = (target.Position - part.Position).Unit * 50 -- Initial force
bodyVelocity.Parent = part
-- Simulate the overshoot and return:
while (part.Position - target.Position).Magnitude > 1 do
bodyVelocity.Velocity = (target.Position - part.Position).Unit * 50
wait(0.05)
end
bodyVelocity:Destroy()
bro don’t chat gpt your answers on forum, i did use chatgpt and gemini ai before posting here and couldnt find anything.
also i dont want to involve ANY physics
c : change in value (end value minus start value) e.g. Object.Position.X - Orb.Position.X
d : duration (how long your easing takes)
function BackEaseIn(t, b, c, d, s)
s = s or 1.70158 -- The overshoot amount, can be adjusted for more/less "back" effect
t = t / d
return c * t * t * ((s + 1) * t - s) + b
end
Here is the code if all that was too confusing: (i wrote this myself)
local function BackEaseIn(t, b, c, d, s)
s = s or 1.70158 -- The overshoot amount, can be adjusted for more/less "back" effect
t = t / d
return c * t * t * ((s + 1) * t - s) + b
end
local Target = Object
local Orb = Orb
local Duration = 0.5; -- in seconds
local StartTime = tick()
repeat
Orb.Position = Vector3.new(
BackEaseIn(tick() - StartTime, Orb.Position.X, Target.Position.X - Orb.Position.X, Duration),
BackEaseIn(tick() - StartTime, Orb.Position.Y, Target.Position.Y - Orb.Position.Y, Duration),
BackEaseIn(tick() - StartTime, Orb.Position.Z, Target.Position.Z - Orb.Position.Z, Duration)
)
task.wait(1 / 60)
until tick() - StartTime >= Duration
Orb.Position = Object.Position
Make sure to say your issues here
Its 3 am for me right now and there are 3 cups of coffee in my digestive system (been awake for 18 hours)
So expect issues in this code
Nope, the idea to use forces was not generated with AI - only the code as mentioned,
I simply generated a code for you on, to give you an idea of how to implement forces.
But thanks for letting me know that you do not want to use forces,
but I will continue to use ChatGPT 4o for my workflow.
after debugging your code, this is the final and working version:
orb.Touched:Connect(function(hit)
if hit.Name == "PickupHitbox" then
local function easeInBack(t, b, c, d, s)
s = s or 1 -- The overshoot amount, can be adjusted for more/less "back" effect
t = t / d
return c * t * t * ((s + 1) * t - s) + b
end
local Duration = 0.5;
local StartTime = tick()
repeat
orb.Position = Vector3.new(
easeInBack(tick() - StartTime, orb.Position.X, hit.Position.X - orb.Position.X, Duration),
easeInBack(tick() - StartTime, orb.Position.Y, hit.Position.Y - orb.Position.Y, Duration),
easeInBack(tick() - StartTime, orb.Position.Z, hit.Position.Z - orb.Position.Z, Duration)
)
task.wait(1 / 60)
until orb.Position == hit.Position
end
end)
Great to hear it worked!
Also you may want to remove the 1 / 60 in task.wait if you want your easing to look even smoother in 120 fps. That’s a mistake I made.