- Home /
Question by
theUndeadEmo · Jan 18, 2012 at 11:09 PM ·
gameobjectscreen
3d gameobject positioning on screen screen resolution
Hello,
I have a 3d gameobject attached to the camera (healhtbar)
http://i1086.photobucket.com/albums/j460/EmoUtd/Random%20pics/healthbar.jpg
what i am baffled about is how to i position this object depending on the screen height/width
i have these sets of codes, but baffled from how I take it from here
private GameObject hbar;
private float sWid = Screen.width;
private float sHei = Screen.height;
private Vector3 screen;
void Update () {
hbar=GameObject.FindWithTag ("hbar");
screen = Camera.main.WorldToScreenPoint(hbar.transform.position);
}
Comment
Your answer

Follow this Question
Related Questions
How to Get Gameobject position on screen resolution that not passed the resolution to set 0 Answers
How to set position of 4 gameobjects at the bottom of the screen? 1 Answer
How to get an object to fill 3/4th of the screen. 0 Answers
How to mask gameObject by gameObject 4 Answers
How rotate a gameobject in Y axis using the mouse position at screen? 1 Answer