When I set the sprite z rotation to 180 it flips the sprite fine and fire the projectiles in the right direction.
However as soon as I change quaternion.indentity to quaternion.Euler(0,0,180) the enemy ships rotoate but not 180.
I have checked all rotations and cannot see where its getting this rotation from.
All rotations are fine until I add Euler.
Here is the code:
using System.Collections;
using System.Collections.Generic;
using Unity.Mathematics;
using UnityEngine;
public class EnemySpawner : MonoBehaviour
{
[SerializeField] List waveConfigs;
[SerializeField] float timeBetweenWaves = 0f;
[SerializeField] bool isLooping;
WaveConfigSO currentWave;
void Start()
{
StartCoroutine(SpawnEnemyWaves());
}
public WaveConfigSO GetCurrentWave()
{
return currentWave;
}
IEnumerator SpawnEnemyWaves()
{
do
{
foreach(WaveConfigSO wave in waveConfigs)
{
currentWave = wave;
for(int i = 0; i < currentWave.GetEnemyCount(); i++)
{
Instantiate(currentWave.GetEnemyPrefab(i),
currentWave.GetStartingWaypoint().position,
quaternion.Euler(0,0,180),
transform);
yield return new WaitForSeconds(currentWave.getRandomSpawnTime());
}
yield return new WaitForSeconds(timeBetweenWaves);
}
}
while(isLooping);
}
}