Character locked in one direction

Cloud brings player back to map through a Bezier curve, to stop the player “sliding” on cloud I update the player’s cframe each renderstep with the cloud. It works fine apart from the player is locked into facing one direction.

local function updateT()
      local oldPos = cloudGroup.PrimaryPart.Position
      local newPos = cubicBezier(tVal.Value,p0.Position,p1.Position,p2.Position,p3.Position)
      local offsetVec = newPos-oldPos
      thisPlr.Character:SetPrimaryPartCFrame(CFrame.new(thisPlr.Character.PrimaryPart.Position + offsetVec))
      cloudGroup:SetPrimaryPartCFrame(CFrame.new(newPos)) 
end

Multiply the CFrame with the primarypart.CFrame.Rotation to add in the original rotation.

1 Like

local function updateT()
local oldPos = cloudGroup.PrimaryPart.Position
local newPos = cubicBezier(tVal.Value,p0.Position,p1.Position,p2.Position,p3.Position)
local offsetVec = newPos-oldPos
thisPlr.Character:SetPrimaryPartCFrame(CFrame.new(thisPlr.Character.PrimaryPart.Position + offsetVec))
cloudGroup:SetPrimaryPartCFrame(CFrame.new(newPos))
end

Cloud brings player back to map through a Bezier curve, to stop the player “sliding” on cloud I update the player’s cframe each renderstep with the cloud. It works fine apart from the player is locked into facing one direction.

EDIT: I’ve tried adding thisPlr.Character.Humanoid.Rotation = Vector3.new(0,0,0) after each SetPrimaryPartCFrame() and it doesn’t work.

How do I keep the player facing in the same direction as they move?

Thanks