Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Rotating New GUI In Realtime

$
0
0
I am trying to make a compass system and I have a script that is able to rotate objects to look at other objects, however when trying to use this script with the new GUI. To rotate the compass point to a specific object, it does not rotate the GUI image. It appears to flip the image 90 degrees on the Y-axis and then it is frozen in that place. I have also noticed though, that you cannot rotate UI elements when paused, so is there no way to set it the new GUI to rotate in real time? Here is the script: using UnityEngine; using System.Collections; public class LookTowardsSpecifiedTarget : MonoBehaviour { public GameObject objectToLookAt; void Update() { if (objectToLookAt != null) { Vector3 v = objectToLookAt.transform.position - transform.position; v.x = v.z = 0.0f; transform.LookAt (objectToLookAt.transform.position - v); transform.Rotate (0, 180, 0); } } }

Viewing all articles
Browse latest Browse all 7934

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>