- Home /
Question by
ratchetunity · Aug 21, 2019 at 12:39 PM ·
rotationuilookatminimapworldtoscreenpoint
Minimap arrows
Hi!
I'm making a minimap for my 3D game using a top-view camera attached to the player and a rendertexture. The minimap has a circular shape and is the child of a screen-overlay canvas. The issue I'm facing is that I want to create arrows on the minimap rotating around the minimap and pointing at quest locations (something like this https://aionpowerbook.com/powerbook/Mini-Map), but I must be missing something as long as it isn't working. This is the code I'm using at the moment:
private void Awake()
{
mainCamera = Camera.main.transform;
player = GameObject.FindGameObjectWithTag("Player").transform;
}
private void Start () {
transform.localPosition = Vector3.zero;
name = name.Remove(name.Length - 7, 7);
target = GameObject.Find("QuestLocations").transform.Find(name);
}
private void Update () {
transform.LookAt(target.position + player.rotation * Vector3.forward, player.rotation * Vector3.up);
}
Any ideas how to solve my problem?
Comment