Tweening part help!

image
2.
image
3.
image
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.

Any help would be appreciated.

See the wiki on how to use TweenService

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()

Try tweening the orientation of the part.

You could use CFrame.Angles, and math.rad().
Or you could use the Orientation property. (Make sure to use Vector3.new() when using Orientation.)

local event = ReplicatedStorage.Events.Tween
local activation = script.Parent.Parent.Activation
local tweeningInfomation = TweenInfo.new(

1,
Enum.EasingStyle.Bounce,
Enum.EasingDirection.Out,
1,
false,
0
)

-- Original: 57.967, 1.143, -422.803
-- New: 58.11, 1.134, -422.803

local partProperties = {
Orientation = Vector3.new(0, 0, 10);
Position = CFrame.new(activation.Position.X-0.143,activation.Position.Y -0.009, activation.Position.Z)
}

wait(5)

local tween = TweenService:Create(activation, tweeningInfomation, partProperties)
tween:Play()

This is what I had and this didn’t work.

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.

You’re setting Position to a CFrame.

You can tween the rotation.
(30 characters)