I’m working on a Breakout-type clone, so I have multiple blocks next to each other and I’m using the code below in the Update to spin them between -25 and 25 degrees on the x axis.
void Update()
{
transform.localEulerAngles = new Vector3((Mathf.PingPong(Time.time * rotateSpeed, 50) - 25), 0, 0);
}
Now I want to offset them a little bit at the start so they don’t spin the same way. I’ve seen the following code before but it doesn’t work for me.
void Start()
{
transform.Rotate(Vector3 * (transform.position.x + transform.position.y) * 0.1f);
}
I’m pretty new to Unity so I have no idea what I should do, I appreciate any help.