I created a _rigidbody and used GetComponent so now the _rigidbody have AddForce but i need the AddForce to be part of the rigidboady of the shot variable.
using UnityEngine;
using System.Collections;
public class Shooter : MonoBehaviour {
public GameObject bullet = null;
public float bulletSpeed = 500f;
private Rigidbody _rigidbody;
void Update ()
{
if (Input.GetKeyDown(KeyCode.F))
{
GameObject shot = (GameObject)Instantiate(bullet, transform.position
+ (transform.forward * 2), transform.rotation);
_rigidbody = GetComponent<Rigidbody>();
shot.rigidbody.
}
}
}