when you right click, a prefab as placed a little bit in front of where you are standing (FPS, Java Script.)

exactly what the title says.

How Would I Make It So That when you right click, a prefab as placed a little bit in front of where you are standing (FPS, Java Script.)

use somethin like:

if (Input.getmousebuttondown(1))

{

Instantiate (prefab , transform.position + transform.forward * awayDistance)

}