I’m trying to track a ball from either side of a rink for my ai.
I accomplish this by leaving nodes on offensive and defensive side and a middle of net. These decide which is being used for the supportive ai chasing ai and keeper as a move to location.
As those who worked with ai generally it lags behind a player as the location it receives to goto is always a step behind.
So to get around this I’m trying to take the balls movement as seen in the example a red line and adjust the other lines which are ideal spots for ain’t try and get to to keep position.
Problem is with a line trace when the ball it’s a wall it’s end point goes forward through the wall. I suppose I could use if hit use hit location then drawn down for the floor vector to be the location but I’m hoping to instead limit the angles of the initial trace.
Is there an ideal formula to clamp a trace so it will go say only 75 degrees in the trace start location in the components local rotation so it never draws backwards.