Custom Hand Skins
Updated a year agoMake sure to properly set up your Unity project using this guide.
Custom skins for hand only work when it is associated with a standard survivor skin. When the associated survivor skin is selected, your custom hand skin will be used in VR. To do that let's first create a HandSkinDef in your Unity project.
HandSkinDef
Create a HandSkinDef by right clicking the explorer in the project tab, then click on Create
> VRMod
> HandSkinDef
.
Here are the different properties you will find in a HandSkinDef:
Character Body Name: The name of the character body. You can find that name in the table below.
Original Skin Name Token: The name token of the associated survivor skin. If the skin was created using KEB's skin builder, the name token should look like [SKINAUTHOR]_SKIN_[SKINDEFINITIONNAME]_NAME
.
Hand Type: The affected hand. If both hands should look the same, choose Both
. Otherwise, you will need to create a second HandSkinDef for the other hand.
Renderer Info Overrides: This is where the magic happens. You can override any number of renderer infos to replace meshes and materials. Here are the different properties in an override:
-
Renderer Info Index: The index of the renderer info to override. If you're making a skin for a vanilla or another VR supported survivor, you can check the table below to find the right index to replace.
-
Mesh Override: You can assign a new mesh that will replace the original.
-
Material Override: You can assign a new material that will replace the original. If the same material is used on the character's skin in flatscreen, you can instead leave this blank and activate the next parameter below.
-
Copy Material From Character Model: If enabled, this will attempt to search the character model to copy the material applied on it and use it as the material override. A match is found if the material name is the same or has an extra "Alt" keyword in it, or if the name of the mesh renderer is the same as the one in the hand's renderer info.
-
Default Shadow Casting Mode/Ignore Overlays/Hide On Death: These are usual properties for skins which you shouldn't really worry about unless you know what you're doing.
Vanilla survivors table
Character | Body Name | Renderer Infos |
---|---|---|
Commando | CommandoBody | 0. Hand 1. Pistol |
Huntress | HuntressBody | Dominant: 0. Bow String (Line renderer, so no mesh replacement possible) 1. Bow 2. Hand Non-Dominand: 0. Hand |
Bandit | Bandit2Body | Dominant: 0. Hand 1. Shotgun 2. Revolver 3. Second Hand (when holding the shotgun two-handed) Non-Dominant: 0. Hand 1. Dagger 2. Shiv |
MUL-T | ToolbotBody | 0. Hand/Weapons 1. Rebar 2. Canister |
Engineer | EngiBody | Dominant: 0. Hand 1. Button Base 2. Button 3. Antenna Base 4. Antenna Base 2 5. Antenna Tip 6. Blueprint Handle 7. Blueprint Display Non-Dominant: 0. Hand 1. Static Mine 2. Spider Mine |
Artificer | MageBody | 0: Hand |
Mercenary | MercBody | Dominant: 0. Hand 1. Sword Non-Dominant: 0. Hand |
Rex | TreebotBody | Dominant: 0. Needle Gun Non-Dominant: 0. Flower |
Loader | LoaderBody | 0. Mech Arm 1. Hand |
Acrid | CrocoBody | 0. Hand |
Captain | CaptainBody | Dominant: 0. Shotgun Non-Dominant: 0. Hand 1. Accessory |
Railgunner | RailgunnerBody | Dominant: 0. Hand 1. Railgun 2. Second Hand (when holding the railgun two-handed) Non-Dominant: 0. Hand 1. Concussion Mine Base 2. Concussion Mine Shell 3. Slow Mine Base 4. Slow Mine Shell |
Void Fiend | VoidSurvivorBody | Dominant: 0. Hand Non-Dominant: 0. Arm 1. Metal Tip |
Modded survivors table
Character | Body Name | Renderer Infos |
---|---|---|
Enforcer | EnforcerBody | Dominant: 0. Default Shotgun 1. Hand 2. Double-Barrel Shotgun 3. Tear Gas Grenade 4. Heavy Machine Gun Non-Dominant: 0. Shield 1. Hand |
Samus | DGSamusBody | Dominant: 0. Gun Base 1. Gun Emissive Non-Dominant: 0. Hand |
Importing the skins into the game
If you have access to the custom hands prefabs of the character, you can add your HandSkinDefs in the Skins
field in the Hand component. Otherwise, you can use this guide, but instead of adding hand prefabs to the asset bundle, add you HandSkinDefs. For the code at the end, the type of asset to load is ScriptableObject
and the method to use to add your skins is MotionControls.AddHandSkin
. Your code should look something like this:
using BepInEx;
using UnityEngine;
using VRAPI;
namespace CustomVRCharacter
{
[BepInPlugin("com.DrBibop.CustomVRSkin", "CustomVRSkin", "1.0.0")]
[BepInDependency("com.DrBibop.VRAPI")]
public class CustomVRSkin : BaseUnityPlugin
{
private void Awake()
{
RoR2.RoR2Application.onLoad += LoadCustomSkins;
}
private void LoadCustomSkins()
{
//If the VR mod is installed and has motion controls enabled
if (VR.enabled && MotionControls.enabled)
{
//Load the asset bundle
AssetBundle assetBundle = AssetBundle.LoadFromMemory(Properties.Resources.mybundle);
if (assetBundle)
{
//Load the hand prefab
ScriptableObject handSkinDef = assetBundle.LoadAsset<ScriptableObject>("MyCustomSkin");
if (handSkinDef)
{
//Add the skin def
MotionControls.AddHandSkin(handSkinDef);
}
}
}
}
}
}