Quantcast
Channel: Questions in topic: "issue"
Viewing all articles
Browse latest Browse all 827

Strange rotation problem? need to remove then re-Add Component

$
0
0
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?

Viewing all articles
Browse latest Browse all 827

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>