Hey guys,
Im creating a script for a “horror” game and I am quite a noob.
My scripts purpose is to move an object to a different location on the map when the player collides with it using other.transform.position.
public class PickUpAndCount : MonoBehaviour {
public GameObject[ ] teleportPoint;
// Update is called once per frame
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == “PickUp”)
{
//other.gameObject.SetActive (false);
other.transform.position = teleportPoint [0].transform.position;
}
}
}
this is what I have so far. i can get the gameobject to teleport once to another empty game object.
I cant for the life of me figure out how to make this happen a second or a third time and I am trying to be able to collect 5 objects total.
If anybody could throw a few tips my way I would greatly appreciate any help.