Trying to make a character face forward but it keeps facing backwards

So I have a problem with the client being shown as backwards but the server sees them as normal.

The issue can be seen here:

Code for Client and Server

Server:

local SS = game.ServerStorage
local CPF = workspace:WaitForChild("CutscenePartsFolder")
local bool = false

function Cutscene(Name, Player, WaitDuration, MovingDuration, MovingBack)
	if not CPF:FindFirstChild(Name .. "1") or not CPF:FindFirstChild(Name .. "2") then print("CallCutscene was called, could not find parts in Folder. " + Name) return end
	if not MovingDuration then MovingDuration = 0 end
	if not MovingBack then MovingBack = false end
	if not WaitDuration then WaitDuration = 5 end
	if not Player then Player = "All" end
	
	local PositionalPart = CPF[Name .. "1"]
	local LookPart = CPF[Name .. "2"]
	if Player == "All" then
		for i, v in pairs(game.Players:GetPlayers()) do
			v.DevComputerMovementMode = Enum.DevComputerMovementMode.Scriptable
              		end
	end
	_G.CallCutscene(Player, MovingDuration, PositionalPart, WaitDuration, LookPart, MovingBack)
end

SS:WaitForChild("Bindables").Final.Event:Connect(function()
	if bool then return end
	bool = true
	
	local CFrameOutsideOfHouse = workspace.CutscenePartsFolder.Final1_2.CFrame

	_G.DarkClientGUIBE:Fire("All")
	_G.TeleportPlayers("All", CFrameOutsideOfHouse)
	
	local AddedVector = Vector3.new(-48, 0, 0)
	Cutscene("Final1_")
	
	for i, v in pairs(game.Players:GetPlayers()) do
			wait()
			local oldcframe = v.Character:GetPrimaryPartCFrame()
			v.Character:SetPrimaryPartCFrame(oldcframe * CFrame.Angles(0, math.rad(180), 0))
			print(v.Character.PrimaryPart.CFrame)
			wait()
			v.Character.Humanoid:MoveTo(v.Character.Head.Position + AddedVector)
	end
	_G.DarkClientGUIBE:Fire("All")
	
	
end)

Client:

ReplicatedStorage:WaitForChild("CutsceneRE").OnClientEvent:Connect(function(MovingDuration, EndingCFrame, WaitDuration, StartingCFrame, MovingBack)
																	
	if not StartingCFrame then
		StartingCFrame = game.Players.LocalPlayer.Character.Head.CFrame
	end
	if MovingDuration == 0 then
		MovingDuration = 0.01
	end
	local cam = workspace.CurrentCamera
	cam.CameraType = "Scriptable"
	if typeof(EndingCFrame)== "Instance" then
		EndingCFrame = EndingCFrame.CFrame
	end
	if typeof(StartingCFrame) == "Instance" then
		StartingCFrame = StartingCFrame.CFrame
	end
	
    for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
		if v:IsA("Part") then
			
	       	  v.LocalTransparencyModifier = 0
		end
    end
	cam:Interpolate(EndingCFrame,StartingCFrame, MovingDuration)
	wait(WaitDuration)
	if MovingBack then
	for i, v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
		if v:IsA("Part") then
	       	v.LocalTransparencyModifier = 1
		end
    end
		cam.CameraType = "Custom"
	end
end)

Next ones are Server Sided
_G.CallCutscene Function:

_G.CallCutscene = function(Player, MovingDuration, EndingCFrame, WaitDuration, StartingCFrame, MovingBack)
	
	if Player == "All" then
		CutsceneRE:FireAllClients(MovingDuration, EndingCFrame, WaitDuration, StartingCFrame, MovingBack)
									
	else
		CutsceneRE:FireClient(Player, MovingDuration, EndingCFrame, WaitDuration, StartingCFrame, MovingBack)
	end
end

_G.DarkClientGUIBE:

local DarkClientGUIBE = BindablesFolder:WaitForChild("DarkClientGUIBE")

DarkClientGUIBE.Event:Connect(function(Player, Duration)
	if Player == "All" then
		DarkRE:FireAllClients(Duration)
		return
	end
	DarkRE:FireClient(Player, Duration)	
end)

_G.DarkClientGUIBE = DarkClientGUIBE

I hope someone can help me, thanks in advance!

Edit: Just tried using an RE to tell the client to rotate, that didn’t work either

Did you try rotating the character via script? If so did it change?

Is the player zoomed in fully during this? Try zooming them out slightly so the direction the camera is facing isn’t changing the direction the character is facing.

Yes, I used this to rotate the character. It changed on the Server but not on the client.

The game is a first person one, but I do call the cutscene before the character is moved.

I noticed that the player flips for a second, then flips back.

as @koob85 said, it seems to be the first person lock, if you disable it while the cutscene is active it will probably be fixed.

Character facing camera view when in firstperson has very high priority, it is good way to get out of places you get stuck due to physics. I suspect that flip is you setting orientation then it being overwritten again by the zoom.

edit: or you can start the cutscene by orienting the player camera toward the bus then cut to the scene camera (they turn then it shows 3rd person view)

1 Like

I’ve set the camera mode to classic and the max zoom distance to 500 (in the script), but that still didn’t work.

edit: it did work when I changed it via StarterPlayer in explorer, but I want to change it via script

		for i, v in pairs(game.Players:GetPlayers()) do
			v.DevComputerMovementMode = Enum.DevComputerMovementMode.Scriptable
			v.CameraMode = Enum.CameraMode.Classic
			v.CameraMaxZoomDistance = 500
        end

I don’t think just changing it on the camera will change the character control scheme.

you may need to change something a bit more directly on the character/humanoid to make it work

Can’t find anything on the humanoid related to cameras other than CameraOffset

Cameras aren’t my thing, currently looking through the PlayerModule. There could be a super simple way to fix this, but it is currently beyond me.

1 Like

Thanks for helping, I’ve basically been stuck all day.

Also beyond me but should work, if you have the server take network ownership of the character during the scene and just remove client from the equation. If this is something you are familiar with.

I haven’t worked with that, but I guess I’ll look into it since I’m basically stuck, thanks

conceptually once server takes ownership, the client should stop affecting your model and you already have scripted movement.

It may still override on client… I can’t tell :confused:
I need to sleep. Good luck, hope someone with a better answer drops by.

1 Like

Thanks for trying to help, but it still goes backwards.

The reason is that your character is in first person. Try turning off AutoRotate on the player’s humanoid and then make it face a certain direction (using cframe.new). Like this:

--cutscene fired, do the function and this
hum.AutoRotate = false
char:SetPrimaryPartCFrame(char.PrimaryPart.Position, -(char.PrimaryPart.Position + char.PrimaryPart.CFrame.LookVector))
--cutscene finished?
hum.AutoRotate = true

(this wasn’t tested)
Hope this helped.

4 Likes

Thank you so much, this worked!

2 Likes