Hello, I am trying to make this part bounce upwards and forwards at the same time. My problem is actually keeping it 1 stud forward, it goes one stud forward midair, then back down it goes again. Here is an example of what it looks like when I try to debug it:
sorry for shitty quality you can probably tell i made this vid on roblox recorder lol
And here is the code to this part:
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
0.5, -- Time
Enum.EasingStyle.Sine , -- EasingStyle
Enum.EasingDirection.Out, -- EasingDirection
0, -- RepeatCount (when less than zero the tween will loop indefinitely)
true, -- Reverses (tween will reverse once reaching it's goal)
0 -- DelayTime
)
local tween = TweenService:Create(script.Parent, tweenInfo, {Position = script.Parent.Position + Vector3.new(0, 5, 1)})
script.Parent.ClickDetector.MouseClick:Connect(function()
tween:Play()
end)
[spoiler] you’d be surprised how many forum posts just so happens to have swears in it, trust me.[/spoiler]
Yes, that’s exactly what i want however it’s not staying going for forward in the z-axis, it’s going forward then back where it came back from, which is good for the y-axis, but not for the z-axis.
The code does technically make a bounce effect, however, how can I make it higher even though stepy1 goes up in the y axis by 5 studs (yeah, I could switch 5 but that’s not really easy to keep track of, right?)