Adding transform.localPosition.y to pitch makes it rotate crazy

I am not fully sure how does transform.localPosition.y affects the pitch but it is caused the ship to turn to rotate on the X axis crazily( going up to 80 regardless of going up and down).
Without that variable, the rotation on X axis works properly (rotate up to 20 moving up and rotate down to -20 moving down).

Any idea of the purpose of transform.localPosition.y being added into the equation?
Thanks

Hi,

The idea behind transform.localPosition.y is to make the rotation dependent on the position of our ship on the screen. That’s all.

If the rotation is too extreme, tweak the values of the variables that we exposed in the Inspector. Rick’s values might not work for your game because your game might have a few differences, which is perfectly fine. :slight_smile:


See also:

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms