so im trying to make a portal gun and i need to get the part orientation that the mouse is aiming at so i can rotate the portal depending on the orientation of the walls heres what i've tried so far:
script.Parent.hit.OnServerInvoke = function(player,hitp) workspace.Blue.CFrame = hitp workspace.Blue.Orientation = Vector3.new(0, 0, 0) print("blue") end script.Parent.hit2.OnServerInvoke = function(player,hitp) workspace.Red.CFrame = hitp workspace.Red.Orientation = Vector3.new(0, 0, -90) if hitp.Orientation.Y == 90 then workspace.Red.Orientation = Vector3.new(0, 90, -90) print("Red") end end
but mouse.hit is a cframe so that doesnt work i even tried changing what is in if to
if hitp == CFrame(0,90,0) then end
and too putting CFrame.new
I don't think you can get the orientation of the mouse's hit, instead use Mouse.Target
and get the orientation of the target maybe?