Hello! I tried to tween a ball to bounce up and down but it doesnt look realistic. Are there any easing styles or anything I can do to my code to fix this? Here is my code:
spawn(function()
while script.Parent.Enabled == true do
local tween = script.Parent.Background.ImageLabel:TweenPosition(UDim2.new(0.448, 0,0.414, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, timez)
wait(timez)
script["bounce boing sound effect"]:Play()
local tween = script.Parent.Background.ImageLabel:TweenPosition(UDim2.new(0.447, 0,math.random(0.2, 0.3), 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Linear, timez+0.3)
wait(timez+0.3)
end
end)
You’re using Enum.EasingStyle.Linear which isn’t realistic because in real life when you throw a ball up in the air; it gets faster as it goes down cuz the Potential Energy (PE) transfers to Kinetic Energy (KE) which makes it faster as it comes down eventually to a halt.
I’d recommend trying Enum.EasingStyle.Back as it goes a bit further than it’s target then moves back. Here’s an example of it in action form another DevForum post: