Hi all!
I am trying to brainstorm ways to rotate a GameObject that I am instantiating with mouse clicks…heres how that works:
var particle : GameObject;
bbox = GameObject.FindWithTag("Respawn");
function Update ()
{
if (Input.GetButtonDown ("Fire1"))
{
var ray = Camera.main.ScreenPointToRay (Input.mousePosition); // Construct a ray from the current mouse coordinates
var hit : RaycastHit;
if (Physics.Raycast (ray, hit))
{
Debug.DrawLine (Camera.main.transform.position, hit.point, Color.red);
Debug.Log(hit.point);
Instantiate (bbox, hit.point, Quaternion.identity);
}
}
}
Can’t seem to figure out how to rotate it on the instantiation…it needs to be visible to the user. Should I yield until mouse release and then use MouseOrbit before the mouse is released? Any advice would be awesome!