Hello everyone, as the post’s name says, I am trying to make a character face a certain way without giving them the possibility of looking away, for example, I tried using a ‘Body Gyro’ but, it was futile since when ‘Shift Lock’ is activated, the person can just face another direction and it’d be overwritten by it.
Another method I tried, was binding a function to ‘RenderStepped’ using ‘RunService’ but to no avail, when I activated ‘Shift Lock’ again, It almost worked, but it didn’t, It let the character face to the side of where it was supposed to be looking, this has nothing to do with the Orientation or Position values, as when I deactivate ‘Shift Lock’ it goes to the position it’s supposed to be initially. Screenshot:
As you can see in the picture, the character is facing where ‘Shift Lock’ is indicating them to, instead of the original position which is facing the other player:
I’m open to suggestions regarding what I should do to solve this situation. I’ll provide the code for the “Bound to 'RenderStepped method” below. Thanks for sticking around and reading!
wait();
local rp = game:GetService("ReplicatedStorage")
local Remotes = rp:WaitForChild("Remotes")
local Player = game.Players.LocalPlayer
local Remote = Remotes.Lock
local RunService = game:GetService("RunService")
Remote.OnClientEvent:Connect(function(Bind, Root, Pos1, Pos2, additionalValue)
if Bind == true then
if additionalValue == nil then
spawn(function()
RunService:BindToRenderStep("lockOrientation", (Enum.RenderPriority.Input.Value + 1), function()
Root.CFrame = CFrame.new(Pos1, Pos2)
end)
end)
elseif additionalValue ~= nil then
spawn(function()
Root.CFrame = CFrame.new(Pos1, Pos2 + additionalValue)
end)
end
elseif Bind == false then
spawn(function()
local success, message = pcall(function() RunService:UnbindFromRenderStep("lockOrientation") end)
if success then
print("Unbinded the orientation of ".. Player.Name)
else
print("Couldn't unbind ".. Player.Name.. "'s Orientation")
end
end)
else
return;
end
end)