Hello Unity Community!
Okay, so I have kind of a noob question here:
This is what I need to accomplish:
In my platformer game, I have portal objects that lead you to the next level, but I don’t want the player to get mowed by an enemy as soon as they enter the next level, so I added an empty game object with a collider to serve as the player’s “Safe Zone”, and I have a method to find out what location it should be at based on the level the portal takes you to.
My Problem:
I need the safe zone to be upright, but not all of my portals are upright, and I’m too unfamiliar with Unity’s rotation system to figure out how to get it upright.
private void Start()
{
levelTracker = FindObjectOfType<LevelTracker>();
safeZone = transform.GetChild(0);
Debug.Log(transform.rotation.z);
safeZone.Rotate(____________________); // Problem spot is here.
Vector2 position = new Vector2(0, 0);
// Vector2 position = levelTracker.GetLevelLocation(levelNumber);
// position += new Vector2(0f, 0.6f);
safeZone.position = position;
}
Can somebody explain to me how to do this considering I don’t yet know how Unity’s rotation metrics work?