2.
3.
So I want a tween so that it will play when some hits this, I already have the hit script, but all I need it a guide on how to make it go back a little bit and spring back up, I have watched many tutorials, but I can’t figure out how to do this.
I have read this, but not sure how to get it to rotate and I tried using the parts orientation but it doesn’t work for some reason, so i’m not sure how to do it.
Here is a simple script, you will need to change some things:
local TweenService = game:GetService("TweenService")
local Part = game.Workspace.Part-- Your part here
local Info = TweenInfo.new(
2,--Number in length
Enum.EasingStyle.Bounce, -- Easing sytle
Enum.EasingDirection.InOut, -- Easing direction
0, -- how much times it repeats
true, -- if it does it in reverse or not
0 -- delay
)
local Goal = {Position = Vector3.new(-14.4, 3.2, 0.8)}-- copy the position you wantin the ()
local Tween = TweenService:Create(Part, Info, Goal)
wait(3)
Tween:Play()
According to the wiki, the Orientation is not a property that can be tweened. Instead, you could do this:
Create three parts (part that you will animate with TweenService, part to be the Start Position, and part to be the End Position) and move/rotate those parts where you want them. Then, just tween the CFrame of the part you want to tween to match up with your end position part’s CFrame. To tween back, tween to match the start position part’s CFrame.