Monday, August 12, 2013

UNITY: Unity Strategy Games[1] Core Mouse Control (tutorial)

I've decided that the only way I'll remember any of the tutorials I've watched is to write notes.  Guess what I'll be using this blog for.

Unity: RTS Mouse Control (by Unity Chat):
http://www.youtube.com/watch?v=g1P2Q9xKCAs

Notes:
- Camera.ScreenPointToRay: draws a line from where you click on screen, to where it lands in 3D space.

- Debug.DrawRay(ray.origin, ray.direction*rayCastLength, Color.yellow);: Draws a yellow indicator of raycast hit.  Can only be seen in the 'SCENE' view.

- to put an item at the mouse location, tell the GameObject (whatever item you want at your mouse point) to make it's transform the position of the ray hit.

No comments: