Rigidbody error

I’m currently using Rigidbody to move a capsule. I want to move it up, but for some reason it only goes down. Any ideas?

public class generater : MonoBehaviour {
	
	public float speed;
	public GameObject[] generateObjects;
	public float timeDelay = 5;
	
	//private int randValue;
	//private float getTimer;
	private GameObject currentObj;
	private Vector3 objStart;
	private Vector3 currentObjPos;
	
	// Use this for initialization
	void Start () {
		
		//getTimer = GameObject.FindGameObjectWithTag("Player").GetComponent<life_time>().max_time;
		objStart = new Vector3 (0.5f, -3.8f, 0f);
		
		InvokeRepeating ("createObj", timeDelay, timeDelay);
	
	}
	
	
	void createObj()
	{
		currentObj = Instantiate(generateObjects[0]) as GameObject;
		currentObj.transform.position = objStart;

	}
	
	void Update()
	{
		if(GameObject.FindGameObjectWithTag("enemy"))
		{
			currentObj.transform.rigidbody.AddForce(0f, 0f, speed);
		}
	}

Also I have frozen all over axis except for the y position in RigidBody.

you are adding force to the wrong axis, up axis is the middle one :wink:

lol. Just…Thanks.

Sorry. Not so fast, it’s still broken.

	void Update()
	{
		if(GameObject.FindGameObjectWithTag("enemy"))
		{
			currentObj.transform.rigidbody.AddForce(0f, speed, 0f);
		}
	}

No matter how I do it, the y value of the object always goes down.

EDIT: I removed the force line and compared results. It looks like the object is acting as if there is no force applied.

Any idea why a rigidboy might negate this force?

SOLVED: During a remodel. I forgot to set the tag. Thanks for the help.