- Home /
how can i orient camera towards right side on different screen resolutions
i have a 2d game for mobile. in the right side there is a canon and from left side enemies keeps coming. so for this level i need to orient camera on right side showing the cannon. how can i achive this. on some devices the canon becomes invisible. as a regular game i dont want solutions such as fit the screen. the left portion can be adjusted but right side should be always visible
Answer by _haseeb · Jul 21, 2015 at 11:41 AM
i made a quick fix like this. i placed a sprite with 1 px width and height and named it dot. then used the below script
void Update () {
GameObject go = GameObject.Find ("dot");
if (!go.renderer.isVisible) {
transform.position = new Vector3(transform.position.x - 0.01f,transform.position.y,transform.position.z);
}
}
this works after placing the dot to $$anonymous$$imum required position. but a small animation like camera movement at the begening
Your answer
Follow this Question
Related Questions
Why does my app function correctly in Unity Remote but not compiled as an app? 0 Answers
Check Camera Permissions for iOS and Android? 0 Answers
Phone camera autofocus 0 Answers
Orthographic Static 2D Background - IOS/Iphone 3,4 & 5 1 Answer
how to hang a 3d model hanging seamlessly from a camera 1 Answer