I have two separate playermodels. I want to activate one and deactivate the other OnTriggerEnter.
Basically I am making a Mario type game, and want the character to turn into the flame Mario when he eats the flower, except with Amedeo Avogadro and an Avocado. (For chemistry EC.)
Code:
using UnityEngine;
using System.Collections;
public class avoc : MonoBehaviour {
public Player GameObject.Find(“Player”);
private Vector3 vectorforobject;
public GameObject prefab;
void OnTriggerEnter(Collider avoc)
{
if(avoc.tag == "avogA")
{
vectorforobject = avoc.transform.position;
Instantiate(prefab, vectorforobject, Quaternion.identity);
Destroy(Player.gameObject);
}
}
}`