My player object has started to act weirdly and now when I respawn the object (after a death) the instantiated version has some components turned off. In this case its main script and audio source.
![alt text][1]
picture on left is the game object as seen in edit mode. Picture on right is the prefab as seen in edit mode.
![alt text][2]
picture on left is the instantiated object during runtime. Pic on right is the prefab during runtime.
the controller script -
public GameObject playerShip;
public Transform respawnPoint;
void OnTriggerEnter (Collider other)
{
if (other.tag == "Bolt")
{
Instantiate(playerExplosion, transform.position, transform.rotation);
Destroy(other.gameObject);
Destroy(gameObject);
Instantiate(playerShip, respawnPoint.transform.position, respawnPoint.transform.rotation);
LivesManager.lives -= 1;
}
Why is the clone turning off its script and audio source ???
[1]: /storage/temp/44150-p1.png
[2]: /storage/temp/44152-p2.png
↧