I need help with Orientation

so i want to change the character character to look at the wall
video:https://i.gyazo.com/6885e0c607d998dce5c73e04fa2864f6.mp4
what i want: https://gyazo.com/ecaff3fb9efaccaf4b6300c4bad51554

	spawn(function()
			while true do
			wait()
				if onwall == true then
					local ray = Ray.new(Head.Position,Head.CFrame.LookVector * 2)
					local hit, pos, normal = workspace:FindPartOnRay(ray,Char)
					print(hit)
					if hit == nil then
						if lol == true then
							lol = false
							HRP.CFrame = CFrame.new(pos,Normal-Normal)
							HRP.CFrame = CFrame.new(HRP.CFrame.p,Vector3.new(HRP.Position.X - Normal.x,HRP.Position.Y,HRP.Position.Z - Normal.z))
							Hum.AutoRotate = false
						end		
					end	
				end	
			end	
		end)
	end	
end)

I don’t exactly know how to rotate a player’s body. (I didn’t make any scripts that changed the player’s rotation) but you can try CFrame.Angles

is it possible to change the humanoidrootparts orientation with CFrame.Angles(x,y,z)?

I tested it and yes it does but I’m trying to do it for every side you go to.

wdym by “I’m trying to do it for every die you got too.”

Trying to make the player body change to look at the part when they go to the other side https://i.gyazo.com/6885e0c607d998dce5c73e04fa2864f6.mp4

Ah okay. Is it possible you could add a part that triggers an event to change it? Or maybe, you could check the player’s position relative to the cube and if it hits a certain spot then reorient the player?

Its Okay but if its possible to make the character to look at the block it would be nice but in all way yes i can do that

I think this is what you need:

https://developer.roblox.com/en-us/api-reference/function/Model/SetPrimaryPartCFrame

How should i implement this into the part of the script

Isn’t that used for Position and not Orientation?

1 Like

I need to make the user just look at the part and really that’s it but i don’t know how.

local Player = game.Players.LocalPlayer

game:GetService("RunService").RenderStepped:Connect(function()
	local Character = Player.Character
	if Character ~= nil then
		local hrp = Character.HumanoidRootPart
		if hrp ~= nil then
			hrp.CFrame = CFrame.new(hrp.Position, workspace.Part.Position)
		end
	end
end)

Try this? its not too good but maybe you can make it better

If you want to turn the root part to the right just do:

hrp.CFrame = hrp.CFrame * CFrame.Angles(0, math.pi/2, 0)

I want it to go around the block every time like a example of the climbing is rogue linage

You could make the camera type attached to what your looking at. If you need it to rotate make invisible blocks and every (second as an example) a script makes your camera attach to one of the invisible blocks.

Here’s a example https://gyazo.com/ecaff3fb9efaccaf4b6300c4bad51554

Exactly. Whenever you don’t detect a ray the character will turn 90 degrees. Also it probably doesn’t work because you have to put a ignore list. The way that you are using “Ray.new” is deprecated and I recommend using the “workspace:Raycast()” method. That way you can add the head to the ignore list and the ray won’t detect the head. Also please tell us what is printed in the output.

btw i’m new to this stuff so i need help…

this is exactly why i run my own sharex server lol