Making a Character face a certain way, without making him able to look away

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:

image

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:

image

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)
1 Like

Have you tried Anchoring the HumanoidRootPart, and then setting their CFrame?

1 Like

Yep, same result as body gyro, but with the difference that the character doesn’t return to the original position unless done so manually.

1 Like

Try turning off the auto rotate property located in the humanoid

I’ve had this problem before and toggling this property fixed it

2 Likes

Thank you! I’ve hunted far and wide for a solution like this, a simple bool value switch to fix a problem that took me 1 day to find a fix for! You’re amazing!

2 Likes