armeture script

So basically want I here an object with a collider and when the character walks through the collider, the object is moved to that object’s position via the armature. however I keep getting these errors every time the character enters the collider.

NullReferenceException: Object reference not set to an instance of an object
PickUp.collect () (at Assets/Scripts/PickUp.cs:19)
PickUp.LateUpdate () (at Assets/Scripts/PickUp.cs:13)

I can’t really pick up on what I’m doing wrong here and I’d appreciate some help :).
Here are my scripts.

inside the object with the collider:

using UnityEngine;
using System.Collections;

public class Grab : MonoBehaviour {

	PickUp PickUpScript;

	// Use this for initialization
 void OnTriggerEnter(Collider other){
		PickUpScript = other.GetComponentInParent<PickUp> ();
		PickUpScript.grabbed = true;
		PickUpScript.area = transform.position;
	}

 void OnTriggerExit(Collider other){
		PickUpScript = other.GetComponentInParent<PickUp>();
		PickUpScript.grabbed = false;
	}
	
}

inside the character:

using UnityEngine;
using System.Collections;

public class PickUp : MonoBehaviour {

	public bool grabbed;
	public Animator anim;
	public Vector3 area;
	public Vector3 rotate;

	void LateUpdate(){
		if (grabbed) {
			collect ();
		}
	}

	void collect(){
		Component armature = gameObject.GetComponent("Armature");
		armature.transform.position = area;
	}
}

Double clicking the error leads you directly to the line causing it in MonoDevelop. in your case the call to GetComponent in line 18 returns no objects why the error in 19 is the NullReference (your accessing a null object). it’s say you need to change GetComponent(“Armature”); to GetComponent(Armature);

You don’t need gameobject infront, but be sure your Armature script is attached to the same Gameobject this pickup script is attached to.