LENS STUDIO: BUTTERFLIES
An asset for Lens Studio that instantly adds butterflies to your scene.
If your device has Lidar, they can even land on it and avoid collisions with it!
It works without any coding!
If you want to change parameters for the butterflies on runtime, this is what you could use:
– Spawn a number of butterflies (n is a whole number). This function is called on start if ‘spawnOnStart’ is more than 0.
– Remove all currently instanced butterflies
– Get or set the butterfly moving speed
– Get or set the ‘hyperactive’ character trait of the butterflies
– Get or set the random sizes of newly spawned butterflies (vec2 containing min, max)
– Get or set the strength at which butterflies follow the transform
– Get or set the radius around the followed transform to stay in (world space)
– Get or set the transform for butterflies to follow (uses position only, default is this Butterfly Controller’s Transform)
– Get or set whether butterflies should land on the world mesh occasionally (world mesh generation/lidar needed) – when ebabled, script.api.deviceTrackingComponent is required for it to work!
– Get or set whether butterflies should avoid collisions with the world mesh (slower, especially when there are a lot of butterflies flying around)
– Get or set the Device Tracking Component needed (necessary when landing on world mesh is enabled)
– Get or set the world mesh classifications that butterflies can land on (indices, from here)
– Get the array of currently instanced butterfly Scene Objects
– Get the array of cloned butterfly materials (one for each variation)