GUI.Draw Texture Positioning

Hey,

So this might be a stupid question but I am somewhat new to Unity and find this confusing. I am currently making a game that uses a health bar and speed boost bar. I have been drawing them as rectangles on the screen using GUI.DrawTexture(xPosition, yPosition, etc…)

Where xPosition = Screen.width/2;

I would therefore expect the rectangle to be located in the middle of the screen (or just off since it moves from the bottom left corner), but instead it pops up maybe 1/4 way from the left. Why is it doing this?

I suspect it has something to do with screen space vs world space, but don’t know enough about it. Any insight would be appreciated!

The question is, if your texture has, 220px of width and u put screen.width/2 your texture will be positioned from the extreme left corner in the givin (screen.with/2), so you need just do this: Screen.width/2 - 220, and bang! you got it in the middle.