When I launch my game in the editor, everything goes well, the rotation of my player is smooth. But when I build the game on my phone, the rotation is not smooth, as if the update function was taking too long to execute. The gameplay is jerky
My new update function :
public class Player : MonoBehaviour
{
void Update()
{
transform.Rotate(new Vector3(0, 0, 160 * Time.deltaTime));
}
}
It’s a very simple game (just this script), 5 batches, high FPS, and my phone is powerful (pixel 6)
rotateSpeed = 160 just in case it’s relevant.
Maybe there is a settings to set to be smooth on phone ?
What could be the problem ?
Hey @luc0lagarde .From what i understood of your code u have multiplied Time.deltaTime to the whole vector. Time.deltaTime i a very small value and that being the case ur whole vector is getting multiplied by a very small value(<<1) so the function will rotate it by very small angles
Multiply Time.deltaTime to rotateSpeed and see if u get the desired result
Profile the game to get information on what is causing performance to drop. It’s highly likely not this script that is causing performance to drop but something else in your scene. You can get information if it’s rendering or physics for example. If it’s rendering, try changing shaders to some simple shader and profile again. If performance improves, then you know it’s using that shader that is causing performance drops.