Hey there I been researching about how to do this but I cant seem to find a way. What i want is my player to collide with a gameobject which then changes to another character. any suggestions people ? Would really appreciate it as I am still in my learning stages of unity
I need to do this without using c# because we havent learnt that yet
I feel that a good way to do this would be to destroy the current charactor and instantiate a new (another) character in its place. Although there are different ways, but this is how I would have done :
var differentCharactor : GameObject; //add the charactor *prefab* in this variable through the editor
var posToSpawn : Transform;
function OnTriggerEnter(other : Collider){
if(other.gameObject.tag == "player")
posToSpawn.position = other.gameObject.transform.position ; //record the character's position
Instantiate(differentCharactor , posToSpawn.position, other.gameObject.transform.rotation); //instantiate prefab at same position and with same rotation
Destroy(other.gameObject); //destroy the old charactor
}
}
I have assumed that the gameobject that changes the character has a trigger collider and the player has a tag called βplayerβ.