I’m creating an A* pathfinding algorithm and I’m trying to draw 4 rays in all directions:
- One which will be pointing forward
- One to the back
- One to the left
- One to the right
To draw the forward ray, I simple used:
forwardRay.origin = transform.position; forwardRay.direction = transform.forward;
Works perfectly, but how do I add a side ray? It must be added to the forwardray, but I’m stuck with what kind of rotation method I have to add.