Hello everyone. So i’m making a script where when you click a button a part will tween itself to another parts position. On the fourth line I tried to make it so it goes to section ones position. There Arte two section ones: the button and a part. In this case on line 4 its the part. How do I make it so it goes to that parts position?
local TweenService = game:GetService("TweenService")
local PartToTween = workspace.CameraRelated.CameraPart
local Properties = {
Position = Vector3.new(workspace.CameraRelated.Section1.Position)
}
local TweenInformation = TweenInfo.new(4.5,Enum.EasingStyle.Sine,Enum.EasingDirection.Out)
local Tween = TweenService:Create(PartToTween, TweenInformation, Properties)
script.Parent.MouseButton1Click:Connect(function()
Tween:Play()
end)
From,
File
you dont need to create a new Vector3 on the 4th line since the Position Property of a part is already a Vector3
I know but it doesnt work.As I said above.
does it error? If not where is the script located. Is it a local script?
its a local script. There are no errors.
Why don’t you try using :lerp()
Did you get rid of the Vector3 creation?
What do you mean by that? I dont really understand,
Im new to scripting so I dont know that many terms.
You are creating a new Vector3 value on line 4. I don’t think that would work as you are giving it the position of a part. Also what is the script parented too
Search for it on google I know DevKing has a video on it and many websites can help you
okay I will when I have the chance.
so I just read an article and a couple of videos. I dont feel comfortable using it since I still dont really know much about it. I rather use tweening since it was the original thing I learned on how to use vector3.
but is there a way to fix this by doing it with using tweening?