I need to create an obstacle bypass script but I can not use NavMeshAgent to do this because this project relies on implementations where NavMeshAgent does not work.
Notice that in the image below there are two cubes and one obstacle, the blue cube represents the player while the red cube represents the enemy. The red cube has a Raycast that identifies whether the blue cube is near (red line), and then moves in the blue cube direction using a Vector3.forward
and LookAt
, but if there is any obstacle ahead of the red cube the locomotion must be modified so that there is a deviation.
What would be the correct way to do this deviation? remembering that I can not use NavMeshAgent in any case.