- Home /
Set a steady angle between gameObject and Screen
Hello, I'm quite new to unity so I will neeed your help with an issue I'm facing. I'm trying to place a gameobject to a specific position on the screen. So far I've managed to set his trasform.position to the values I needed by using the script below in the update function:
GameObject m2;
m2=GameObject.Find("m2");
float fl=40.1f;
Vector3 vec=new Vector3(Screen.width/2.9f, 50f,fl );
m2.transform.position = Camera.main.ScreenToWorldPoint(vec);
The object uses another mechanism to apppear on my screen so I need to position it manually for every frame to be able to override it's default behavior. The code above works fine but it doesn't stabilise the object's angle relative to the screen. I need it to always be 90 degrees. Can you please help me?
Your answer
Follow this Question
Related Questions
Rotate camera around gameobject 1 Answer
A node in a childnode? 1 Answer
Positioning Textures on screen 0 Answers
Camera not displaying any gameobjects in scene 4 Answers
How to make the camera is not break trough object? 2 Answers