Description
The Vector3.Random
property provides a way to generate a random 3D vector. This vector is uniformly sampled from all points within a unit sphere centered at the origin, meaning that the distance from the origin to the point is at most 1. This can be useful for generating random directions or positions within a bounded space.
Usage
To use the Vector3.Random
property, simply access it as a static property of the Vector3
struct. It does not require any parameters and will return a new Vector3
instance each time it is accessed.
Example
// Example of using Vector3.Random
Vector3 randomVector = Vector3.Random;
// Output the random vector
// Note: Avoid using Console.WriteLine in s&box
// Instead, use the appropriate logging or debugging tools available in your environment
Log.Info($"Random Vector: {randomVector}");