Launch an object with collision against the world
- A configurable joint is connected to a world-constrained kinematic rigidbody and given velocity on the Z-axis.
- The joint has collision and stops against the world.
- A particle system under the joint dies with collision, causing a particle stop action disable, triggering a contact-driven parameter change.
Rigidbody.Launcher-15.mp4
- Merge the Animator Controller
Rigidbody Launcher FX
to your own FX Controller, using the Avatars 3.0 Manager tool. - Drag & drop the
Rigidbody Launcher
prefab into the base of your Hierarchy. - Right click and unpack the prefab, then drag & drop it onto your avatar.
- Move
Rigidbody Launcher Target
outside ofRigidbody Launcher
and place it anywhere in your avatar's hierarchy. Adjust the transforms as needed.
- Place the objects you want to to use inside
Rigidbody Launcher
->Container
.- Alternatively you can constrain the objects to
Container
.
- Alternatively you can constrain the objects to
RigidbodyLauncher/Control
parameter must be true for the system to fire, and false to reset.- To change speed, you can edit the
Launcher Fire.anim
animation clip and change theTarget Velocity
. You need to use a negative value.- You can also change the
Maximum Force
property under theX/Y/Z Drive
sections of theRigidbody Launcher/Kinematic Rigidbody/Collision
configurable joint. - Other properties of the joint on
Collision
are editable depending on the rigidbody motion you want to achieve.
- You can also change the
- To launch the rigidbody perfectly straight, freeze rotation for XYZ on the
Collision
rigidbody (not the configurable joint), and set the X and Y motion on theCollision
configurable joint as locked.- This will make it so only Z-axis motion is possible.
Audio Sources: 2
Colliders: 1
Constraints: 4
Contact Receivers: 1
Contact Senders: 1
FX Animator Layers: 2
Lights: 1
Particle Systems: 1
Rigidbodies: 3
Rigidbody Launcher
|-Container
| |-Cube
| | |-Point Light
| |-Collision Audio
| |-Fire Audio
|-Kinematic Rigidbody
| |-Collision
| | |-Box Collider
| | |-Contact
|-Rigidbody Launcher Target
Rigidbody Launcher is available as-is under MIT. For more information see LICENSE.