Commit ce991bfa by Philipp Adolf

Fix shields not being deleted on restart

parent 97c74495
......@@ -12,6 +12,7 @@ public class ShieldScript : MonoBehaviour
// used to store the position while the trap is deactivated
private Vector2 spawnPosition;
private Transform spawnParent;
public float relayDelay = 0.25f;
private bool canRelay = true;
......@@ -21,6 +22,7 @@ public class ShieldScript : MonoBehaviour
void Start()
{
spawnPosition = transform.position;
spawnParent = transform.parent;
pickupAudio = GetComponent<AudioSource>();
}
......@@ -53,7 +55,7 @@ public class ShieldScript : MonoBehaviour
CancelInvoke("stopShielding");
if (parentHealth != null) parentHealth.setShield(false);
parentHealth = null;
transform.parent = null;
transform.parent = spawnParent;
transform.position = new Vector2(100, 100);
Invoke("Activate", respawnTime);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment