I’m trying to make this part that is attached to another part using a motor6d have a tween that simply goes up and down
local part = script.Parent
local pos = part.Position
local ori = part.Orientation
local size = part.Size
local tweenService = game:GetService("TweenService")
local changes = {
Position = pos + Vector3.new(0, 0.3, 0)
--Orientation = ori + Vector3.new(0, 360, 0)
--Color = Color3.new(0, 0, 0)
--Size = size + Vector3.new(0, 0, 0)
}
local tweenInfo = TweenInfo.new(
2, -- Time taken for a full animation
Enum.EasingStyle.Quad, -- Animation Style
Enum.EasingDirection.InOut, -- Animation Type
-1, -- Number of repeats (-1 is infinite)
true, -- Reverse?
0-- Delay between animations
)
local tween = tweenService:Create(part, tweenInfo, changes)
tween:Play()
this is a group that is inside the player’s HumanoidRootPart
this is how it’s supposed to look if it was a normal part, is there a way for me to properly do this?
Not sure of your hierarchy, however, just make sure you are not putting parts as children of parts.
If your effect is in a model, set the models parent to the player.Character
Here is just a quick example of tweening a part connected with a motor 6d, in this case the player Character’s Head
put this in a local script under …
local part = script.Parent:WaitForChild("Head")
local motor = part:WaitForChild("Neck")
local tweenService = game:GetService("TweenService")
local changes = {
C0 = motor.C0 + Vector3.new(0,1,0)
}
local tweenInfo = TweenInfo.new(
2, -- Time taken for a full animation
Enum.EasingStyle.Quad, -- Animation Style
Enum.EasingDirection.InOut, -- Animation Type
-1, -- Number of repeats (-1 is infinite)
true, -- Reverse?
0-- Delay between animations
)
local tween = tweenService:Create(motor, tweenInfo, changes)
tween:Play()
sorry for the really late reply, there’s a hurricane passing by so there’s been a ton of rain and internet as gone down multiple times, using the motors worked, thank you so much!
local tweenService = game:GetService("TweenService")
local changes = {
C0 = motor.C0 + Vector3.new(0,1,0)
}
local tweenInfo = TweenInfo.new(
2, -- Time taken for a full animation
Enum.EasingStyle.Quad, -- Animation Style
Enum.EasingDirection.InOut, -- Animation Type
-1, -- Number of repeats (-1 is infinite)
true, -- Reverse?
0-- Delay between animations
)
local tween = tweenService:Create(motor, tweenInfo, changes)
tween:Play()