Description
This plasmasaber uses the new systems from avatar dynamics to allow for interactive stabbing, slicing, and throwing! The plasmasaber is fully set up with sounds, particles, and animations when hitting people and other objects.
Disclaimer: This prefab is not quest-compatible.
If you have any issues with the prefab please contact me on discord (Wolfy#2727) and let me know so I can fix it ASAP!
Version updates at the bottom of the page.
Plasmasaber Stats:
Triangles: 6,482
Materials: 6 (1 Mesh, 5 Particle Systems)
Particle Systems: 5
Max Particles: 1,591
Audio Sources: 6
Real-Time Lights: 1 (Optional)
Senders: 2
Receivers: 4
Memory (Parameter) Allocation: 5 Bits (13 With Hue Slider)
Physbones: 1
Set-Up:
NOTE: This prefab works with Write Defaults on or off, but they are defaulted to off so you will have to turn them on in the animator.
Import "Plasmasaber Prefab" into your project.
Drag and drop the "Plasmasaber" prefab onto your avatar base, right-click it, then click "Unpack Completely."
Open up the "Plasmasaber" game object in your hierarchy and navigate to the "PLACE THESE ON AVATAR" game object and drag and drop the "Hand Constraint," "Elbow Constraint," and "Holster Constraint" game objects to their respective locations on your avatar's armature. Note: The "Holster Constraint" game object can be placed wherever you wish, but the "Hand Constraint" and "Elbow Constraint" game objects must go on the Hand and Elbow on your avatar's armature.
Once you have placed the constraints, zero out their positions in the transform. You will likely need to zero out the rotations on the elbow constraint if your avatar is in A-Pose, rather than T-Pose for the throwing to work properly on your avatar.
Next, open up the "Saber World" game object and then the "Saber Container" game object and click on the "Plasmasaber" game object and turn on the mesh renderer.
We'll want to check the parent constraint locations. With the plasmasaber's mesh renderer still on, click on the "Holster Constraint" game object and move/rotate it around to get your desired location/look of the plasmasaber when holstered.
You'll want to check that the plasmasaber's scale is to your liking for your avatar, if not, press "R" with the plasmasaber selected and scale it evenly in all directions to fit your avatar's size.
Click on the "Saber Container" game object and change the weight of the "Holster Constraint" game object to zero and the "Hand Constraint" game object to one and then adjust the "Hand Constraint" game object's position and rotation to your liking in your hand. Make sure to change the weight of the "Holster Constraint" game object back to one and the "Hand Constraint" game object back to zero when you are finished adjusting things.
***SKIP IF YOU DID NOT NEED TO SCALE THE SABER*** You will want to open up the "Plasmasaber" game object drop-down and then turn on the "Saber Blade and Hum" game object and click on the the "Blade Color" game object and the "Inner Blade" game object and press "R" to scale them together at the same time. Just scale them up or down to fit right into the edge hilt where the beam would come from and then turn the "Saber Blade and Hum" game object off.
NOTICE: If you want the plasmasaber to impact performance less, you can delete the real-time light labeled "Blade Light" under the "Saber Blade And Hum" game object.
Click on the "Plasmasaber" game object just under the "Saber Container" game object and turn off the plasmasaber's "Mesh Renderer" component.
You will want Avatars 3.0 Manager from the VRLabs Github page to merge your FX layer with the plasmasaber FX layer. With Avatars 3.0 Manager installed you will navigate through the top bar through "VRLabs" --> "Avatars 3.0 Manager" and with that screen opened you will drag and drop your avatar's base from the hierarchy into the "Avatar" slot in the AV3 Manager window.
Open up "FX" in the AV3 Manager window and scroll down to "Add Animator to Merge" and click it. Click the circle on the right of the "Controller" option in the AV3 Manager window and find "RH Saber FX" or "LH Saber FX" (or the quest-friendly gesture controls FX controllers) depending on which hand you are using and you set up your constraints for.
Click "Merge As New" to have it merge your current FX with the Plasmasaber's FX into a new controller which can be placed on your avatar.
The last step is to place the networked parameters in your avatar's expression parameter list. Click on your avatar's base, scroll down in the avatar descriptor to "Expressions" and open that up. Click on the "VRCExpressionsParameters" and then add the parameters from the FX layer that are under "Synchronized Parameters" and add a toggle to your expressions menu that uses the "Plasmasaber/Net/Toggle" parameter to toggle the plasmasaber on and off in the menu.