I am trying to figure out how I can check if the part is on the ground and not on a wall or ceiling by using Raycast that aims towards the ground. The problem is, Raycasts are not good with orientation and it’s confusing to find a way to find the right angle.
Basically, what I am trying to do is make a teleport script where the player can only teleport if their mouse is pointed on the ground and not on the wall or the ceiling and I use a Raycast to check the distance between a part positioned at the mouse’s 3D position and the ground below and check if the distance is around 1 stud so that way, it confirms that the position is on the ground. Can anyone help me resolve this?
Nope, it doesn’t detect any part’s touched underneath which means the raycast returns nil. I tried increasing the height of the part’s position but that didn’t work.