Make an object Rotate and Translate?

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”.

To make life easier, you could use an empty gameobject and place your object in there. That way you can have one object to translate and the other to rotate and dont have them interfere.

When using this setup, you can also use transform.Translate() because your parent object isnt rotating. Maybe this will help against the wonkyness.