- Home /
GUI is not staying where it should
im trying to do a first person shooter game and im using a plus sign in a GUI texture(cus i dont have photoshop) and its moving around randomly as i move the camara, some one know why? thanks
Can you please post the code that sets the GUI in place so we can see what you've done wrong?
there is no code, i just parent it to the camera
Answer by aldonaletto · May 21, 2012 at 01:14 AM
GUITextures have their own interpretation of the position field: while it's a 3D point for other objects, GUITexture and GUIText use their X and Y values as viewport coordinates, varying from 0 (left/bottom) to 1 (right/top) - that's why they seem to not follow the parent.
To do what you want, just unchild the GUITexture: it will stay in the right place without doing anything else.
Your answer
Follow this Question
Related Questions
How To Print Text Random 2 Answers
OnGui Function help 1 Answer
Repeat fade in and out 1 Answer
Understanding GUISkin/GUIStyle BackgroundImage and Border 2 Answers