x


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

more ▼

asked May 20 '12 at 09:11 PM

thenachotech1113 gravatar image

thenachotech1113
131 2 12 21

Can you please post the code that sets the GUI in place so we can see what you've done wrong?

May 20 '12 at 09:32 PM asafsitner

there is no code, i just parent it to the camera

May 21 '12 at 12:38 AM thenachotech1113
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered May 21 '12 at 01:14 AM

aldonaletto gravatar image

aldonaletto
41.4k 16 42 197

thanks a lot, ur ansuer realy comes in handy

May 22 '12 at 01:03 AM thenachotech1113
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3678
x2193
x1366
x571
x118

asked: May 20 '12 at 09:11 PM

Seen: 297 times

Last Updated: May 22 '12 at 01:03 AM