๐ Welcome to the MR Ball Creator! ๐
Step into a magical mixed-reality world where creativity meets physics fun! ๐จ๐โจ With your left and right controllers, you can summon vibrant colored balls ๐ ๐ต๐ข that interact seamlessly with your physical surroundings ๐. Watch them bounce, roll, and collide with the environment, bringing life to your space!
But waitโthere's a twist! โณ Each ball has a 40-second lifespan before disappearing into the void, so keep generating and experimenting! ๐ฎโจ To make things even more immersive, every ball creation comes with its own unique sound effect ๐๐ถ, adding excitement and unpredictability to your gameplay.
Are you ready to unleash your inner creator and fill the world around you with bouncing, colorful joy? ๐๐ Let the fun begin! ๐

Ball Generating Scripts


๐ฏ GenerateObject Script (Left & Right Controllers)
This script lets you create colorful balls ๐ ๐ต๐ข that fly forward when you press specific buttons on your controllers ๐ฎ or keyboard โจ๏ธ. Here's how it works:
Button Press Detection:
Left Controller ๐๏ธ: Press the PrimaryIndexTrigger (or the "B" key).
Right Controller โ: Press the SecondaryIndexTrigger (or the "B" key).
Ball Creation ๐:
When the button is pressed, a new ball ๐ (from the WhatToGenerate object) is created at the script's object's position ๐.
Motion Physics โ๏ธ:
The ball is given a forward velocity ๐ using a Rigidbody component, and the WhatSpeed variable controls how fast it moves.
Sound Effects ๐๐ต:
Every time a ball is generated, a sound plays with a random pitch for a fun, dynamic effect ๐ถโจ.
In short, this script lets you unleash a stream of bouncing, colorful balls into your mixed-reality environment ๐๐!
Self Destroy Script

SelfDestroy โณ๐ฅ
This script ensures the balls disappear after a certain amount of time to keep your environment uncluttered.
Start() ๐: When an object with this script is created, it will self-destruct after 40 seconds โ using the Destroy(gameObject, 40f) command.
Purpose: Keeps the physical environment from being overwhelmed with too many generated balls ๐๏ธโฝ.
Come take a look!
You can find this project and many more in my Github repositories!