I am trying to tween a few parts, but instead the baseplate just slides up.
local sensor = script.Parent.Sensor
local door1 = script.Parent.Door1
local door1to = script.Parent.Door1To
local door2 = script.Parent.Door2
local door2to = script.Parent.Door2To
local tweenService = game:GetService("TweenService")
sensor.Touched:Connect(function()
local tweeningInformation = TweenInfo.new(
1, -- Length
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0 -- Delay
)
local partProperties1 = {
Position = Vector3.new(door1to.frame.Position)
}
local partProperties11 = {
Position = Vector3.new(door1to.glass.Position)
}
local partProperties12 = {
Position = Vector3.new(door2to.frame.Position)
}
local partProperties122 = {
Position = Vector3.new(door2to.glass.Position)
}
local Tween1 = tweenService:Create(door1to.frame,tweeningInformation,partProperties1)
local Tween11 = tweenService:Create(door1to.glass,tweeningInformation,partProperties11)
local Tween12 = tweenService:Create(door2to.frame,tweeningInformation,partProperties12)
local Tween122 = tweenService:Create(door2to.glass,tweeningInformation,partProperties122)
Tween1:Play()
Tween11:Play()
Tween12:Play()
Tween122:Play()
end)
Use something like this
local sensor = script.Parent.Sensor
local door1 = script.Parent.Door1
local door1to = script.Parent.Door1To
local door2 = script.Parent.Door2
local door2to = script.Parent.Door2To
local tweenService = game:GetService("TweenService")
script.Parent.Touched:Connect(function(touch)
local humanoid = touch.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
local tweeningInformation = TweenInfo.new(
1, -- Length
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out,
0,
false,
0 -- Delay
)
local partProperties1 = {
Position = Vector3.new(door1to.frame.Position)
}
local partProperties11 = {
Position = Vector3.new(door1to.glass.Position)
}
local partProperties12 = {
Position = Vector3.new(door2to.frame.Position)
}
local partProperties122 = {
Position = Vector3.new(door2to.glass.Position)
}
local Tween1 = tweenService:Create(door1to.frame,tweeningInformation,partProperties1)
local Tween11 = tweenService:Create(door1to.glass,tweeningInformation,partProperties11)
local Tween12 = tweenService:Create(door2to.frame,tweeningInformation,partProperties12)
local Tween122 = tweenService:Create(door2to.glass,tweeningInformation,partProperties122)
Tween1:Play()
Tween11:Play()
Tween12:Play()
Tween122:Play()
end
end)
Edit i actually dont know if this works but i think the problem was that you did Touch but didnt say who touch sorry for grammar
It means that player touched not anything because when i did touch event before when crates was touching to baseplate i got cash but i wanted to make it when player touched So that means when player touched it will start working
Edit:can you say what you wanna achieve like when anything touches to your sensor it start doing that?
Edit2:Btw make sure your script is Script not LocalScript
are there any welds within the tweened part or the baseplate? there might’ve been a roblox-generated weld somewhere that welded the baseplate and cause it to be tween in conjunction
What do you mean the parts don’t animate? You mean they don’t tween? Why do you need the welds? If you’ve got multiple parts, weld them together but make sure they aren’t welded to the baseplate.