Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Rigidbody targetRb;
- private float minSpeed = 12;
- private float maxSpeed = 16;
- void Start()
- {
- targetRb = GetComponent<Rigidbody>();
- targetRb.AddForce(RandomForce(), ForceMode.Impulse);
- }
- Vector3 RandomForce()
- {
- return Vector3.up * Random.Range(minSpeed, maxSpeed);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement