spawn object on keypress c#

Hello,
I’m trying to spawn an object in front of the player when pressing on ‘X’
I’m very new to c# and don’t now how to do this
could anyone help me with this?

if(Input.GetKeyDown(KeyCode.X)) {
Instantiate(obj, ObjectSpawnPosition, Quaternion.identity);
}

Try That.

@The Kracken How do you spawn it at a velocity?