hello, I'm creating a side scroller - when the character gets to the end of a level, the camera changes to a top down view of the Boss Area - all of this works great, except in order for my character to fire projectiles at the mouse (using MouseLookAt script), I have to rotate the players mesh -90 degrees as soon as he enters the play area
public class PlayerMeshRotation : MonoBehaviour
{
public int useLookAt;
void Start ()
{
useLookAt = 0;
}
void Update()
{
useLookAt = PlayerMovement.lookAt;
while(useLookAt == 1)
{
transform.Rotate (0,-90,0);
break;
}
if(useLookAt == 1)
{
useLookAt = 2;
}
}
}
However, the first time I load the scene, this doesn't work - I have to "Remove Component" (that script), then "Add Component" (that same script) - resetting the script does nothing. Any ideas whats happening?
↧