Assign CFrame Position without rotating the player

I have a CFrame I am moving a anchored player with, I want to keep assigning the players CFrame to this CFrame, but I dont know how to change the rotation of the player while doing so. So basically, I want the player rotated a certain way while also assigning the CFrame of the player to another CFrame.

This is part of a very weird system I have for wall sliding. If anyone knows of a controller or something I could use to achieve wall sliding please let me know, as this system is extremely weird. (but works! kind of)

you know CFrame has two parts one for position and one for pos to look at:
CFrame.new(Vector3 Position, Vector3 LookAtPos)

if you want to rotate relative to part then use

Part.CFrame:ToWorldSpace( CFrame.new(position relative to part) * CFrame.Angles( rotation relative to part ) )

I recommend you to look at CFrame tutorial from roblox documenation or youtube whatevr your prefrence is

1 Like

How would I get a parts rotation relative to another parts?

Part.CFrame = CFrame.new(MoveHere.Position, 
					LookHere.CFrame:ToWorldSpace(LookHere.CFrame.Position - MoveHere.CFrame.Position) * CFrame.Angles())

what no, from what I see you can just do this

Part.CFrame = CFrame.new(MoveHere.Position, LookHere.Position)

1 Like
local Part = workspace.Paaart -- The part you want the player to be teleported to
local Player = game.Players.LocalPlayer
local Character = Player.Character

Character.HumanoidRootPart.CFrame = CFrame.new(Part.Position)

maybe this?

1 Like

I am trying to get the cameras position CFrame and point the character to it, I have done that but I want to get a specific angle from it and make it the orientation at which the player is locked to when this is called. I did that by printing out the .LookVector of the player, but I dont know how to convert these numbers to work properly. I just tried using math.rad but it did not produce the desired outcome

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.