Leftmost and rightmost doesnt work

Hi everyone, I was trying to learn this section but I stucked at the beginning.
When I use xmax and xmin its working however when I try to use new method, I cannot use leftmost and rightmost at all. Program doesnt take any variable from screen.

xmin = leftmost.x;
xmax = rightmost.x;

these two still equals to 5. there is no error however it is not taking the size of screen it always use the beginning ones. When I change my code
float xmin = -5f;
to
float xmin; it is not moving either.
My code: code

Is your camera tagged as the main camera?

I agree with @Sebastian_Martens that you’re camera probably hasn’t been tagged as the main camera.
If something isn’t working and you’re getting a NullReferenceException error then it’s definitely worth checking out what’s going on around that problem line. You can just double-click on the error to open the code at that line (10).

thank you @Sebastian_Martens and @garypettie the problem was really that simple. I fixed it now.

Know worries. It can happen to the best of us. :grinning:

help me out a lot tnx…

Sebastian_Martens

Privacy & Terms