3D Projectile Prediction Plane

I want to make a 3D pong style game. I thought of making a prediction plane to tell the player where the ball may go. This was going to be a vertical plane because the ball would not be affected by gravity because pong’s ball was never affected by gravity. I have no idea how this would be done because I am new to game design. I would appreciate the help.

You can raycast out and draw a line renderer to show your predicted path and you could show as multiple bounces, but you would likely want to cap the amount of predicted bounces to 4 for example or it could get quite messy. You can also have an effect to notify players if the prediction is such that the ball bounces out of bounds if the paddle isn’t in the right spot. When you know the direction that the ball is travelling, let’s say it always moves along its positive x axis for example:

Vector3 ballDir = ball.transform.right;

Just do raycasts against colliders and return the reflected direction vector and keep doing that for the amount of reflections / predicted bounces that you want to show and save each reflection point in an array that you pass to the line renderer:

public LineRenderer predictionLine;
Vector3 [] reflectionPoint;

void Start(){

predictionLine.positionCount = 5;
reflectionPoint = new Vector3[predictionLine.positionCount];

}

void Update(){

reflectionPoint[0] = ball.transform.position;
Vector3 ballDir = ball.transform.right;
Vector3 predictionDir = ballDir;
RaycastHit hit;

for(i = 1; i < reflectionPoint.Length; i++){

if (Physics.Raycast(reflectionPoint[i - 1], predictionDir, out hit, Mathf.Infinity)){

reflectionPoint *= hit.point;*

predictionDir = Vector3.Reflect( predictionDir, hit.normal);
}
else
{
//if raycast doesn’t hit a Collider make the remaining line renderer point positions offscreen in-line with the last prediction direction
reflectionPoint = reflectionPoint[i - 1] + ( predictionDir * 1000 ); //you can also do something to notify that the ball is predicted to go out of bounds here
}

}

predictionLine.SetPositions(reflectionPoint); //show prediction via line renderer

}
Hopefully that helps and you get the idea. Code not tested