How do I offset the rotation of my blocks at the start?

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.

Definitely some syntax issues with your code. Whenever you struggle with things like this, make sure you take a step back and brush up on the fundamentals of programming. And as always, check the documentation because there’s always examples for you to learn from.

We can simplify your issue though. Transform.Rotate() can take values for each angle individually, so we only have to worry about the x:

void Start()
{
    transform.Rotate(Random.Range(-25f, 25f), 0, 0);
}