random vector
Details
Kode wheel segment | Math/Random |
Style | Math |
Modifiers | circle / cone / cube / slice / inside / radius / angle / direction / length / size / x,y,z |
Primarily WHEN/DO | DO |
Pre-made brains that use it | Unknown |
Math > Random> random vector
Description
This tile is a Math tile. It is used to create a random vector within a specified area. Normally used with a custom vector variable, though can be used to generate a number between -1 and 1. Unlike sample noise this will generate random numbers on a fixed position object, as it is generating a random number within an area around the object.
Example Code
WHEN [countdown timer][4]DO [vectorvar:my vector][=][random vector][circle][inside][radius][2]
Modifiers
circle, cone, cube, slice: The shape of the area from the objects position vector
inside: By default the random vector will be on the shape edge, this modifier chooses a vector within the shape area instead.
radius: Used with circle. Paired with a number this specifies in meters the size of the circle area.
angle: Used with cone and slice.Paired with a number it specifies the angle of the shape.
direction: Used with cone and slice. Paired with a direction it specifies the orientation of the cone or slice.
length: Used with cone and slice.Paired with a number is specifies the length of the cone or slice.
size: Used with cube and square. Paired with a number is specifies the size of the shape in meters.
x,y,z: Vector position. Specifies whether the vector is a y, z or x coordinate (when used with a number variable)
WHEN [countdown timer][4]DO [numvar:my vector][=][random vector][circle][inside][radius][2][y]
Other Uses
This tile can be used to spawn objects at different positions.
See Tutorial: Create position and orientation