Quantcast
Channel: Answers by "octaviomejiadiaz"
Viewing all articles
Browse latest Browse all 8

Answer by octaviomejiadiaz

$
0
0
hi, i didnt understand where do i have to subtract the the point.y im nbot sure if im using scree height i have this: void Update() { // Find screen position for target point = Camera.main.WorldToScreenPoint(target.position); } void OnGUI() { float yPos = 5.0f; float xPos = 5.0f; float width = ( Screen.width >= 960 || Screen.height >= 960 ) ? 100 : 100; float height = ( Screen.width >= 960 || Screen.height >= 960 ) ? 100 : 100; float heightPlus = height + 0.0f; // In case point.y is inverted, just subtract it from the screen height. Rect rect = new Rect(point.x, point.y, 100, 100); ****** I've tried change the screen height that appears in the code but, that is for some other static GUI buttons. And one more question, how do put a position for example if want that the GUI button follow the object but in a specific position (a square object and the GUI button follow it but always in the corner) appreciate the help!

Viewing all articles
Browse latest Browse all 8

Trending Articles



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