- Home /
what is the newer version of this piece of code?
topWall.size = new Vector2 (mainCam.ScreenToWorldPoint (new Vector3 (Screen.width * 2f, 0f, 0f)).x ,if);
topWall.center = new Vector2 (0f, mainCam.ScreenToWorldPoint (new Vector3 (0f, Screen.height, 0f)).y + 0.5f);
I am learning how to make 2D game, the tutorial is using unity 4.3, but I have unity 5. It's about the camera view thing...
The if at the end of line 1 would need to be a number for this to work in any version of unity.
The methods you are using in this script have not changed a bit from 4.3 to 5.
If you are not getting the desired result from your script. You might change your question accordingly.
By the way: In your first line I guess it must be 0f or something like that ins$$anonymous$$d of "if", I changed that for you ;)
As Gardes suggested.
The mainCam thing is obsolete in Unity 5, and since I think topWall is a Collider .center is obsolete too
Your answer
Follow this Question
Related Questions
Camera problem ,Unity 5 1 Answer
Framing the camera to all objects in scene 0 Answers
How to change main camera and access to the other scripts?? 0 Answers
Camera movement in a 2D? (like angry birds) 1 Answer
Good Game by One Person, Is it Possible? 2 Answers