Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private float maxTorque = 10;
- void Start()
- {
- //spins the objects on a range on all 3 axis
- targetRb.AddTorque(RandomTorque(), RandomTorque(), RandomTorque(), ForceMode.Impulse);
- }
- //spins the objects on a range on all 3 axis
- float RandomTorque()
- {
- return Random.Range(-maxTorque, maxTorque);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement