Add force to GameObject

Hallo! Ich habe in mein Spiel eine Funktion eingebaut mit welcher man schießen kann, leider hat keine der Methoden die ich probiert habe funktioniert dem Projektil eine Geschwindigkeit zu geben, demnach spawnt es und fällt gerade runter. Hilfe pls!

Hello! I included in my game a function with which you can shoot, unfortunately, none of the methods I’ve tried works to give the projectile a speed, therefore it spawns and falls straight down. Help pls!

The Code:

class PersonScriptShooting {

	var projectile : GameObject;
	
	var spawnpoint : Transform;
	
	public var damage = 5;
}
var launchProjectile : PersonScriptShooting = PersonScriptShooting();


function shoot()
{
	if(Input.GetButtonDown("Fire1"))
	{
		var Vektor : Vector3 = Vector3(launchProjectile.spawnpoint.position.x,launchProjectile.spawnpoint.position.y,launchProjectile.spawnpoint.position.z);
		GameObject.Instantiate(launchProjectile.projectile,Vektor,Quaternion.identity);

//		var elevation : Vector3 = Quaternion.Euler(Vektor) * launchProjectile.Spawnpoint.forward;
//		 launchProjectile.projectile.rigidbody.AddForce(elevation * 10);
		 launchProjectile.Projectile.velocity = transform.TransformDirection (Vector3.forward * 10);
	}	
}

you need to have Rigidbody on your GameObject for forces to work

function shoot()
{
if(Input.GetButtonDown(“Fire1”))
{
var spawn : Vector3 = Vector3(launchProjectile.spawnpoint.position.x,launchProjectile.spawnpoint.position.y,launchProjectile.spawnpoint.position.z);
var clone : GameObject = Instantiate(launchProjectile.projectile,spawn,launchProjectile.camera.rotation);
clone.rigidbody.AddForce((spawn - Vector3(launchProjectile.camera.position.x,launchProjectile.camera.position.y,launchProjectile.camera.position.z)) * 50, ForceMode.Impulse);
}
}