Monday, August 12, 2013

UNITY: Unity Strategy Games[2]: Mouse Click Feedback (tutorial)


  1. - Raycast information only stores the hit on the first thing it collides with.
  2. - can put object in 'ignore raycast layer'
  3. - nest animations under hierarchy layer: raycast hit to point item group to ground, then use script to animate item position itself for an animated object indicator.
  4. - Input.GetMouseButton(1); // mouse buttons:
    1. button 1 = 0 (Left)
    2. button 2 = 1 (Right)
    3. button 3 = 2 (scrollwheel)
  5. use animation panel to create animations within Unity.
  6. Animation system: can add keyframes and EVENTS.  Events can call for functions like in actionscripting.
  7. Destroy(this.gameObject);
    1. Destroys this game object.
//------------ code bit --------------
void DestroyObject()
{
     Destroy(this.gameObject);
}
//------- end code bit --------------

to destroy parent:


//------------ code bit --------------
void DestroyObject()
{
     Destroy(this.gameObject.transform.parent.gameObject);
}
//------- end code bit --------------



No comments: