R2 Custom Projectiles
We are excited to share some improvements to R2 Projectiles that we hope will help you make more cool stuff. First, you can now make your own custom projectiles with Rec Room Studio, which can be saved into inventions and shared with others!
We’ve also pulled projectiles directly into circuits with a new Projectile Constant and a chip called Projectile Fire. This works a bit like audio does. The constant will give you access to all existing projectiles, plus any custom Studio projectiles in your room. Download your favorite creator’s Projectile Constant from the invention store and you’ll be ready to fire away.
Making a custom Projectile in Studio
In Rec Room Studio, create a prefab for your projectile and add the new Projectile component. This should be a simple “white scene” object, without extra colliders or other components. If your projectile prefab is too complex or has been converted into a Studio object, you will get an error when uploading.
Then add that prefab to the new Projectile Registry, which can be found in the Rec Room Studio Hierarchy window.
Voila! Upload your room, and now your new projectiles will be available in Projectile Constants for use with circuits.
Projectile Constant
The new Projectile Constant is available in the Maker Pen palette. The pattern is similar to the existing Audio constants. The Projectile Constant can be configured to a specific projectile, then used with the Fire Projectile chip. Spawn the Projectile Constant from the palette and configure it to find the list of projectiles.
If you don’t have any custom Studio Projectiles, you’ll still have easy access to the list of projectiles from the Projectile Launcher. You can also tap into the community resource and download a Projectile Constant invention from the store. Spawning an invention into your room can add new projectiles to this list.
There are a number of configurable options on the Constant that you can fine tune to customize your projectile. These will determine how fast the projectile is, how many are fired on each execution, etc. At the moment, projectiles are always synced.
Projectile Fire
Once you’ve made a projectile, just wire it into the Projectile Fire chip to fire it.
You’ll need to give Projectile Fire a Projectile, a source/origin (which can be either a vector or an object) and a direction of fire.
Using an object as the projectile source will automatically prevent the projectile from colliding with that object. When using a vector, the projectile can collide with anything - so if your vector is inside an object, the projectile may appear to vanish right after it’s fired.
Projectile Events
A few new events have been added to help make the most of these new capabilities. All of these events are available at room level, and fire for projectile hits from all sources - the new chips, the Projectile Launcher, and the existing prop guns.
Inventions
Custom Projectiles work with Inventions, so you’ll be able to easily share your creations with others.
Making an Invention
Making an Invention that includes a Studio Projectile is as easy as including a Projectile Constant chip in the Invention. Whichever Projectile you’ve selected on that Projectile Constant will be included in the Invention and become available to anyone who uses it.
Downloading an Invention
Using an Invention that includes a Studio Projectile is the same as using any other. If you download a turret invention with custom projectiles, it’ll continue to work - and you’ll see that new projectile listed in your Projectile Constants everywhere in the room. Deleting the original invention won’t delete the projectile as long as you’re using it somewhere else.
Coming next…
..We’re doing the same thing for Particle Effects! Look for that in a couple of weeks. Until then let us know what you think of custom projectiles in the comments on this post.
Cheers
~ RR team