Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I rotate my see-saw?

I am trying to use tweening. After watching tutorials I came out with this (doesn't work):

local db = game.ReplicatedStorage.SeeSawdb
local turn = workspace.Turner
script.Parent.MouseButton1Click:Connect(function()
	if db == true then
		db = false
		local ts = game:GetService("TweenService") 
		local info = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.Out,-1)
		local properties = {CFrame = turn.CFrame * CFrame.Angles(0,-15,0)}
		local tween = ts:Create(turn,info,properties)
		tween:Play()
	end
end)

Can someone please help? Thanks in advance!

1 answer

I am not sure why you are using as it will never == true

local db = game.ReplicatedStorage.SeeSawdb

For the rotation CFrame.Angles is in radians use math.rad() to convert degrees to radians.

Lastly there is a completed event for tween you can use to reset your debounce.

3 comments

0

But CFrame.Angles rotates it...but not smoothly... I am looking for something that can rotate it SMOOTHLy

0

And what are radians?

0

If this is a click detector then it will not look smooth as the changes still need to be replicated to the player. If this is for effects only then do this on the client side using a local script.

This discussion is preserved as it was. New answers, comments, and votes are closed.