Search Unity

Resolved An object rotated by a script increases its speed at the beginning and end of the rotation

Discussion in 'Scripting' started by imiotis, Jun 13, 2022.

  1. imiotis

    imiotis

    Joined:
    Dec 22, 2018
    Posts:
    35
    There is a simple code that rotates an object in a semicircle with radius 1 around the point 0,0,0.
    How I do it: I smoothly change the "X" coordinate from -1 to 1 and calculate the "Y" coordinate using the Pythagorean theorem:
    dsdas.png
    For some reason it speeds up at the beggining and at the end of the animation:

    How to make the rotation speed constant?
    wtf.gif
     
  2. imiotis

    imiotis

    Joined:
    Dec 22, 2018
    Posts:
    35
    upload_2022-6-13_2-29-29.png
    this code works!