๐ŸŒŸ 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!
Back to Top