How would I make this wheel spin then stop?

Hey devs, I am curious as to how I can make this valve spin 90 degrees, then stop, when the ProximityPrompt is triggered.

Here is a video of what I mean:

I want it so that when the ProximityPrompt is triggered, the valve spins 90 degrees, then stops spinning.

How can I do this? I have tried messing around with Vector3 and have gotten close, but to no avail.

Try checking these out.
PromptButtonHoldBegan
PromptButtonHoldEnded

That’s not my issue, I know how to operate ProximityPrompts, I want to know how to make the valve turn which I will implement into my ProximityPrompt trigger.

You can change the orientation of the part.

I tried but I can’t manage to do it, how would I regulate so that it spins without teleporting to a different orientation?

You should use TweenService on the Orientation property for a smooth transition

I don’t get how it teleports. I’d say rotate it to whatever you want while seeing what changes in the property. And then, change it using tween service like @Orbular3 said. You regulate that it doesn’t spin too far by just adjusting the position to a set amount.

@Thorize This may help.

Server Script:

TweenService = game:GetService("TweenService")
Part = script.Parent.Parent
Proxy = script.Parent

Properties = { --Create a Table for what you want the TweenService to do.
	Orientation = Vector3.new(90,0,0) -- Set this to whatever suits you
-- Add More if you want to change more.
}


Tween = TweenInfo.new(
	1, -- Time 
	Enum.EasingStyle.Sine, -- How you want your part to Transition
	Enum.EasingDirection.InOut, -- In or Out, why not InOut?
	0, -- Times Repeated
	false -- Reversed?
)

Proxy.Triggered:Connect(function()
	TweenService:Create(Part, Tween, Properties):Play() -- Creates using TweenInfro and then plays it.
end)


Like how @AdarshDev and @Orbular3 said, you can use Tweening

Maybe also use CFrame instead of orientation.

Part.CFrame = Part.CFrame * CFrame.fromOrientation(0, math.pi, 0)

Also using tweens for smooth animation :upside_down_face: