I am making an ImageLabel rotate in the same orientation, PrimaryPart of humanoid has.
But there is a problem, I want it to rotate into opposite direction. How do I do it?
Video of what I mean
while true do
wait(0.01)
script.Parent.Rotation = game.Players.LocalPlayer.Character.PrimaryPart.Orientation.Y + 180
end
Or, since its only changing when the primarypart changes, you can just connect it to when the primarypart does move. This uses far less processing power and is generally less intensive. Here’s the code but more clean / organised
-- use :GetService() instead, if you ever choose to obfuscate service names
local player = game:GetService("Players").LocalPlayer
-- to avoid erroring if the character isn't loaded, wait for it to load:
local char = player.Character or player.CharacterAdded:Wait()
local main = char.PrimaryPart
-- when it changes:
main:GetPropertyChangedSignal("CFrame"):Connect(function()
script.Parent.Rotation = -main.Orientation.Y
end)
hope this helps, but if it does work give the solution to keremMCT since they were the ones who figured out the true logic of it.