Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

pick random point inside box collider unity

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: #pick #random #point #box #collider #unity
ADD COMMENT
Topic
Name
8+1 =