Hello, I have been trying to create a very simple minimap for GoogleVR and having no luck. I need some advice, I learned how to make a normal minimap from Penny De Byl’s awesome tutorials. Her code works well on a UI canvas in Screen Space Overlay, but in VR you can’t use Screen space overlay (not for a minimap). When I switched the Canvas to World Space it still worked fine. The trouble is when I parent it to the main camera, the map icons seem to change their rotational orientation. I suck at trig, but I have a hunch the rotation of the worldspace canvas is effecting the Mathf.Cos & Mathf.Sin but I’m not sure how.
I didn’t want to bother her with yet another question. Here is her code:
void DrawRadarDots(){
foreach (RadarObject ro in radObects) {
Vector3 radarPos = (ro.owner.transform.position - playerPos.position);
float distToObject = Vector3.Distance (playerPos.position, ro.owner.transform.position) * mapScale;
float deltay = Mathf.Atan2 (radarPos.x, radarPos.z) * Mathf.Rad2Deg - 270 - playerPos.eulerAngles.y;
radarPos.x = distToObject * Mathf.Cos (deltay * Mathf.Deg2Rad) * -1;
radarPos.z = distToObject * Mathf.Sin (deltay * Mathf.Deg2Rad);
ro.icon.transform.SetParent (this.transform);
ro.icon.transform.position = new Vector3 (radarPos.x, radarPos.z, 0) + this.transform.position;
}