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

9 comments
Script:16: attempt to call a CFrame value. i get that error in local script, how should i do it??
Getting a Coordinate Frame should always be 'CFrame.new()', NOT 'CFrame()'
so it should be " if tr.Orientation == CFrame.new(0,90,0)"? or without .Orientation
Orientation should be in Vector3.new(x,y,z), if you want to set it all by CFrame you can do CFrame.new(x,y,z) * CFrame.Angles(x,y,z)
ok i will try it
When you set the orientation of the portal, try this. 'Mouse.Hit.CFrame * CFrame.Angles(math.rad(Mouse.Target.Orientation.X),math.rad(Mouse.Target.Orientation.Y),math.rad(Mouse.Target.Orientation.Z))'
yeah it works man thanks alot
Should i use RemoteEvents or RemoteFunctions?
RemoteEvents to pass information, RemoteFunctions to get information from either the server or the client. Could you also mark my response as the answer so that I get the rep and so that nobody tries to answer?