Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

get random point in collider unity

// Use Collider.bounds

public Vector3 RandomPointInBounds(Bounds bounds) {
    return new Vector3(
        Random.Range(bounds.min.x, bounds.max.x),
        Random.Range(bounds.min.y, bounds.max.y),
        Random.Range(bounds.min.z, bounds.max.z)
    );
}
 
PREVIOUS NEXT
Tagged: #random #point #collider #unity
ADD COMMENT
Topic
Name
6+4 =