Lock elevation angle for my object of the area of vision in my minimap

Hi!.

I’ve created a plane with an alpha .png and the transparent material which emulates the area of vision of my minimap.

How this area of vision starts and is attatched to my Ffirst Person Controller, I’d like to know how to eliminate the elevation angle which my area of vision heritages from my First Person Controller.

If I look up and down my area of vision in my minimap looks up and down (obviously) and this is what I want to supress: the elevation angle of my plane (area of vision)because it’s represented in my minimap too.

Thank you in advance.

I’m not sure about what you are actually doing, but if you’re using a top-down camera, don’t child it to the player: use a script to copy the player position to the camera, keeping a reasonable offset - like this (camera script):

var offset: Vector3 = Vector3(0,100,0); // camera 100m above player
var player: Transform; // drag the player here
var speed: float = 4.5; // how fast the camera follows the player

function LateUpdate(){ // LateUpdate is better for camera movement
  // copy the player position using Lerp to smooth a little the movement:
  transform.position = Vector3.Lerp(transform.position, player.position+offset, speed*Time.deltaTime);
}

EDITED:

I thought you were trying to show the map as an image rendered from a top-down camera over the player.

If you just want the triangle to follow the camera direction, use the player’s eulerAngles.y to get the angle:

var player: Transform; // drag the player here

function LateUpdate(){
  // get the player angle about Y:
  angle = player.eulerAngles.y;
  // use the angle to define the triangle orientation
}

In the First Person Controller the camera only rotates up/down - the player rotates left/right and takes the camera with him, thus player.eulerAngles.y shows the current camera angle about Y.

Once you have this angle, you can rotate the triangle to the desired direction. I used this once to draw the player as an arrow texture over a mini-map, both rendered with GUI.DrawTexture, and used GUIUtility.RotateAroundPivot to rotate the arrow.