Hey Everyone,
Since the player path was in a loop in the waypoint circuit, I wanted to implement the same with timelines.
So I have put the Master timeline on loop. But I am facing a problem when it loops.
I want the enemy ships that I have already destroyed in the enemy waves to reappear when the master timeline goes on loop and the enemy waves repeat.
Currently, only the enemies that are not destroyed appear when the waves repeat.
Gameplay video linked below:
Current Gameplay video
The code part of my game is exactly the same as done by Ben in the tutorials.
Current KillEnemy method in Enemy.cs is as below:
private void KillEnemy()
{
GameObject fx = Instantiate(deathFX, transform.position, Quaternion.identity);
fx.transform.parent = parent;
Destroy(gameObject);
}
Instead of Destroy I am thinking of just disabling the gameObject and enabling it again later. I think I can achieve this if I can somehow access the control tracks of the enemy waves in code and whenever the track starts or is about to start I enable all the enemies the particular wave has and then upon hit by the player shipās bullets the enemies are just disabled.
But I donāt know how to do that. There must be a better solution to this problem than the one I am thinking.
Please help me in resolving this problem.