Hey all, So I'm trying to rotate my sprite based on the mouse location i.e if the mouse is to the left of the sprite the sprite faces left, and if the mouse is to the right of the sprite the sprite faces to the right. The code works, but its making my game really choppy, the sprite doesn't run at its maxSpeed, or jump to its max height, and doesn't fall as fast as gravity...all in relation to before I added this mouse look thing. Code (csharp): // calculate the angle of vector from the mousePosition to the spritePosition in relation to the y-axis //clamp the y rotation so it stays 2D if(angle <90 ) angle = 0; else angle = 180; transform.rotation = Quaternion.Euler(0,angle,0); This is how I implement it...if I were to comment out the rotation, my sprite moves,jumps,and falls at normal speeds. But when the line is active...is slows all those thing. Could anyone point me in the direction of why this is happening?
But even if the sprite is flipping every frame, that shouldn't slow things down at all. What if that was a desired behavior? You're saying that it couldn't be done (that is, it could, but with slowing down)? Doesn't seem logical. Setting the rotation of a transform (one transform) every frame should have no visible influence on the fps. Sounds strange.