Hi all …,
In the following unity scene…:
http://iammfa.webs.com/build-01-03-2011.html
you can see a flatten plane with squares colors texture, you can drag this plane by pressing the left mouse button, you can drag and drop it in any direction as you see, my question here:
How can I stop dragging the plane when the plane reach the edges of the screen (top, left, bottom, right) edges?
Hey
Check if the mouse is at the edge of the viewport (not screen). View port is measured 0 to 1 on both axes.
Stop dragging if mouse is < 0 or > 1 on appropriate axis.
Have a look at the docs on camera viewports, that should help a bit with code samples.
Hope this helps.
is there an example code …?