- Home /
Rotate object with different timing...?
hey people,
I have 5 cubes with same script which I have to rotate at same speed with different angle offset.My common script to all cubes has this code and it will rotate all the cubes at same speed and same angle.I want to have the same speed for rotation but different angle for each cube.
//This is not giving what result I want
transform.Rotate(Vector3.up*Time.deltaTime*RotationSpeed);
Please help..!!!
Comment
Best Answer
Answer by OSG · Mar 06, 2014 at 09:06 AM
Try this:
float minCoefVal = 10f;
float maxCoefVal = 20f;
float angleRandomCoef = Random.Range(minCoefVal, maxCoefVal);
transform.Rotate((Vector3.up * angleRandomCoef)*Time.deltaTime*RotationSpeed);
Your answer
Follow this Question
Related Questions
Turning a vector into a local offset? Math help 2 Answers
transform.Rotate For an Certain Amount of Time 1 Answer
Simple LookAt Rotation with offset pivot 2 Answers
How to calculate delta offset time between race cars? 0 Answers
Help With Simple Rotation 4 Answers