For a 2D game, I have a circular object that needs to rotate, move from right to left, and up and down. I feel like I’m partially there, but need advice from someone that’s more familiar with this matter. I have this:
transform.Rotate(0f, 0f, spinSpeed * Time.deltaTime);
Then I have this:
transform.position += new Vector3((-1 * Time.deltaTime), Mathf.PingPong(Time.time, 1), 0f);
This technically works, but because of the += operator, I have a very wonky pingpong that doesn’t work as intended. Any suggestions?
Also, would Mathf.SmoothDamp lessen the “ping pong” effect? I would like for the object to move a little more “fluid”.