RunService rotation

Hey! Im trying to rotate an image label using the RenderStepped function. Everything works as intended but I need to rotate it the other way around which doesn’t seem to work that well. Below is the code I’m using:

RunService.RenderStepped:Connect(function()
	Image.Rotation = tick() * 100 % 360
end)

As stated before, this works as intended but I need it to rotate the other way around. Is there a method I can use do that?

try multiplying by the negative of 100 % 360? like this

tick() * -(100 % 360)

Doesn’t seem to work, all it does is stay in place the entire time.

also why are you multiplying by 100 % 360 when you can just do 100

and maybe try to divide instead?

Try this:

--//Services
local RunService = game:GetService("RunService")

--//Variables
local ImageLabel = script.Parent

--//Controls
local rotationalSpeed = 100 --//Change to negative number to reverse

--//Functions
RunService.RenderStepped:Connect(function(deltaTime)
	ImageLabel.Rotation += deltaTime * rotationalSpeed
end)

This one makes it so that there is the same rotational speed on both high and low fps because it’s using DeltaTime.

local rotationInDegrees = 100
RunService.RenderStepped:Connect(function(deltaTime)
	Image.Rotation += -(rotationInDegrees * deltaTime * 10)
end)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.