Randomize 3D Vector with Scale

  • Share this:

Code introduction


This function is used to randomize a 3D vector, controlling the range of randomization through the given scale parameter.


Technology Stack : Godot Engine

Code Type : Godot Engine

Code Difficulty : Intermediate


                
                    
def randomize_vector(vector, scale):
    import random
    return (random.uniform(-scale, scale), random.uniform(-scale, scale), random.uniform(-scale, scale))                
              
Tags: