So what I am trying to do is so that everytime you press E, the wedge moves +90 degrees.
However, in the script below I thought that doing + Vector would do an addition to my current orientation but in reality all it did was move it to an orientation of 90.
local TweenService = game:GetService("TweenService")
local Wedge = script.Parent
local TurnInfo = TweenInfo.new(
1.668,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In,
0,
false,
0
)
local function getWedgeOrienatation()
return Wedge.Orientation or Vector3.new(0, 0, 0)
end
Spin1 = TweenService:Create(Wedge,TurnInfo, {Orientation = getWedgeOrienatation() + Vector3.new(0, 90, 0)})
Wedge.ProximityPrompt.Triggered:Connect(function(player)
Spin1:Play()
end)
This was because you were just getting the original orientation of the wedge as opposed to updating it each time it is rotated, I’ve made a function which when called returns the current orientation of the wedge, for it to then be used in the tween.
The solution is already given by Forummer right above me. The issue was because you’ve already defined Spin1 in the script & just refer to the same information over & over. Putting it inside the function will always set/update the infomation you want to run. Referring to a already set variable won’t update it, you’ll have to update it yourself.