Unity

From VR Wiki
Revision as of 12:39, 13 May 2022 by Phossu (talk | contribs) (Created page with "Unity is the engine that VRC runs on, so uploading assets to VRC requires use of the Unity Editor. You edit and put together assets such as worlds and avatars and upload them. [TODO]: This entire article: * Installation * Configuration * Useful packages/addons/etc * Tidbits of how to do certain things; IE physbones tips, Constraints, etc. Since it's easier to split articles up than to merge them I'm going to throw almost everything into this main article. = Tidbits...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Unity is the engine that VRC runs on, so uploading assets to VRC requires use of the Unity Editor. You edit and put together assets such as worlds and avatars and upload them.

[TODO]: This entire article:

  • Installation
  • Configuration
  • Useful packages/addons/etc
  • Tidbits of how to do certain things; IE physbones tips, Constraints, etc. Since it's easier to split articles up than to merge them I'm going to throw almost everything into this main article.


Tidbits

Constraints

Moving Props Around with Constraints

Let's say you have a gun in a thigh holster, and you want to 'snap' it to your hand from your thigh, and back again. could be glasses from your face, or whatever. first in blender you want to have it either a separate mesh or separately weighted on its own bone; if you can move it around by moving the bone around this'll work.

1. Create empty objects on the armature where you want the object to snap to. EG; One on the hand (hand_target) and one on the leg (holster_target) 2. Create a parent constraint on the mesh/object you want to be moving around (the gun for example), and give it two sources; the two target objects you made. Set the weights to both be zero (the number next to the source) 3. Activate and lock the constraint. 4. Set the weight of one target to 1. Then move the empty object (if necessary) so the position you want it to snap to. 5. Repeat for the other target.

If done properly (these instructions have not been tested), changing the weight of each source to 1 and the other to 0 will snap the object to that location and it will move along with the relevant bone. You could extend this to move the object around to multiple locations if you wished.

To actually get this working; make an animation that switches the source weighting and make that trigger on a condition, such as a toggle on your radial menu.