Random.onUnitSphere
Declaration
public static Vector3 onUnitSphere;Описание
Возвращает случайную точку на поверхности сферы с радиусом 1.0 (только для чтения).
using UnityEngine;
public class Example : MonoBehaviour { void Start() { // Sets the rigidbody velocity to 10 and in a random direction.
GetComponent<Rigidbody>().velocity = Random.onUnitSphere * 10; } }