Monday, June 27, 2011

Transform.Rotate Idea of instantiating rotating bullets with certain direction

function Update() {
// Slowly rotate the object around its X axis at 1 degree/second.
transform.Rotate(Vector3.right * Time.deltaTime);

// ... at the same time as spinning relative to the global
// Y axis at the same speed.
transform.Rotate(Vector3.up * Time.deltaTime, Space.World);
}



======================================================================================================================================================
function Update() {
// Slowly rotate the object around its X axis at 1 degree/second.
transform.Rotate(Time.deltaTime, 0, 0);

// ... at the same time as spinning it relative to the global
// Y axis at the same speed.
transform.Rotate(0, Time.deltaTime, 0, Space.World);
}

====================================================================================================================================================
function Update() {
// Slowly rotate the object around its X axis at 1 degree/second.
transform.Rotate(Vector3.right, Time.deltaTime);

// ... at the same time as spinning it relative to the global
// Y axis at the same speed.
transform.Rotate(Vector3.up, Time.deltaTime, Space.World);
}



==================================================================================================================================================

No comments:

Post a Comment