I am trying to make a system where I tween a lever down. I know how to tween, and well at that. The problem is that I want to be able to copy this script over and over with out having to change the position value for each one.
The issue is everything I try like "Position -= Vector3.new(0, 2-2, 0) just gets an error
I will provide the code I have tried. Keep in mind this code gets errors.
local serv = game:GetService("TweenService")
local info = TweenInfo.new(.5, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0)
local pos = script.Parent.Parent.Position - Vector3.new(0, 2.2, 0) -- getting error here
local tween = serv:Create(script.Parent.Parent, info, pos)
script.Parent.Triggered:Connect(function()
tween:Play()
end)
The output looks like this:
and in case you wanted to know the lever looks like this: