Hello!
I’m trying to make the block move along a parabolic trajectory. As far as I understand, TweenService can only change the coordinate by the same step. Is there any way I can smoothly change the vertical coordinate regardless of the horizontal one and make a “jump” of the block?
So it’s not a curve but just a jump, correct? So we don’t have to worry about and axis except for the y-axis. This would be quite simple, actually. You can use either a Sine
or Circular
Easing style:
local TS = game:GetService("TweenService")
local Part = -- The part
local TI = TweenInfo.new(TimeLength, Enum.EasingStyle.Circular, Enum.EasingDirection.In, 0, true)
TS:Create(Part, TI, {Position = Part.Position + Vector3.new(0, 5, 0)})
You can’t do this with TweenService.
If you update the position every RenderStepped it will be just as smooth, but you’ll need to do more stuff manually.
Is this the only way to move the part along a given trajectory?
If it was just one direction, then you can use tween service, or you can read up on the formula [ Ax2 + Bx + C =0
] to make one:
I’m not really good at math but I’m sure this may help you.
Like this?
Just made this in 2-4 min. lol.
If you want to use such a BounceStyle you can just use the equation you see in the link, use it in the game (never really done that but well, why not try):
local Part = script.Parent
while true do
wait()
Part.Position.Y = math.abs(math.cos(time())*5)
Part.Position.Z = math.abs(math.sin(time())*5)
--If time dont work, then try tick()
end
It’s not exactly the right code, but now I know where to go next.
Thank you!