- Home /
Help please guys my game almost finished please
Here is the mechanism i want
When Male "Player" enters trigger, it changes into Female "Player"
*Basicly Disabling The Male Prefab (Defult Prefab for Player), Enabling Female Prefab
NOTE : Male and Female are children inside "FILES" that is a children Inside "Player"
Male and Female are both Prefabs that are children of a children inside "Player"
i hope i declared my request enough for anyone who wants to help me please guys that is the only thing i need
Answer by adrienPlayerium · Aug 04, 2017 at 12:04 AM
@MTDues I am not sure to understand what you want. But let's say I got it, your logic might go like that: 1. save Maleplayer transform 2. destroy Male "player" 3. instantiate Female player prefab 4. set Female player tranform to Male transform.
using UnityEngine;
using System.Collections;
public class worldTrigger : $$anonymous$$onoBehaviour {
private GameObject hidey;
void Start() {
hidey = GameObject.Find("hidey");
hidey.gameObject.SetActive(false);
}
void OnTriggerEnter (Collider other) {
if (other.CompareTag ("Player")) {
hidey.gameObject.SetActive(true);
}
}
}
im almost done ,,but the script Turns off the obj before it enters the trigger
anyleads?
Your answer
Follow this Question
Related Questions
Help change the subject of this Script 1 Answer
Singleton implementation 1 Answer
Grab/Throw Mechanic.,Grab/Throw Objects Mechanic 0 Answers
One big script or lots of small ones? 0 Answers
Script executing through walls 1 Answer