Other
Rotating Minimap - Boundary Icons don't rotate
I've followed some tutorials to get icons to clamp at the boundaries of my square minimap. Each icon is a child object of gameobjects that will show up on the radar. This child has the following in its minimapIcon
script;
void LateUpdate() {
<something here using main.camera y rotation?>
transform.position = new Vector3(
Mathf.Clamp(transform.position.x, MinimapCam.position.x - MinimapSize, MinimapSize + MinimapCam.position.x),
transform.position.y,
Mathf.Clamp(transform.position.z, MinimapCam.position.z - MinimapSize, MinimapSize + MinimapCam.position.z)
);
}
The MinimapCam
script, attached to a game second camera (minimap) positions and rotates the minimap based on where the main camera is facing;
void LateUpdate() {
Vector3 newPosition = player.position;
newPosition.y = transform.position.y;
transform.position = newPosition;
transform.rotation = Quaternion.Euler(90f, Camera.main.transform.eulerAngles.y, 0f);
}
But I've noticed the minimap icons clamp in a set square boundary and do not follow the rotation of the map.
Any idea how I can rectify this? I feel I have to add the main.Cameras y rotation into minimapIcon but I'm not sure how.
Follow this Question
Related Questions
Camera X Rotation Problems 0 Answers
Rotating camera not working? 0 Answers
Rotation Lerp Question 2 Answers
camera woobling when i move it around player 0 Answers
How to have objects rotate around a given point that are scripted to face the player 1 Answer