How could i make a part tilt 45 degress and turn based on the cameras cframe

Im trying to make a part that leans foward 45 degress and also leans based on the cameras cframe

this is how far i got

function Stick:DirectionalLogic()
	local primary = self.stick.PrimaryPart

	if (primary) then
		local cam_pos = Camera.CFrame.Position

		primary.CFrame = CFrame.new(primary.Position) * CFrame.Angles(math.rad(45), 0, 0);
	end
end
1 Like

Is this in a loop or do you want it to happen once?

i want it to be in loop so the part turns based on the players camera

function Stick:DirectionalLogic()
	local primary = self.stick.PrimaryPart

	if (primary) then
		local cam_pos = Camera.CFrame.Position

		primary.CFrame = primary.CFrame * CFrame.Angles(0, math.rad(45), 0);
	end
end

Does that work?

No it doesnt, the part gets stuck in the ground and it doesnt face the camera