Toree 2

Toree 2

Not enough ratings
Creating a custom playable character
By Crash
Forewarning: You will need a basic knowledge of a 3D modeling program such as Blender or 3DSMax, I use blender so this guide will mostly be using that terminology.

You will need the custom playable characters[www.nexusmods.com] mod for having the playable characters appear ingame

Please Note:
Any used instance of [charactername] should be replaced with your character's name, please refrain from using spaces or weird characters as unity may not be able to properly read them.

Everything in this guide is case sensitive so please type things exactly as worded.
   
Award
Favorite
Favorited
Unfavorite
Pre-Steps
Download unity version 2020.3.0f1[unity3d.com]

once you make a new project (type 3D)

download this Unity Plugin[github.com] and put into the project's Assets folder (in a folder named editor):
Setting up the model:
For making the model there's nothing really specific here, create your model then set up an armature and rig it.

I'm not the best at explaining the concept of Armature and Rigging so I'll drop some videos I find helpful here!

When exporting a model try to keep the model as one object! It won't ruin anything if it's not but it's far easier to work with in the long run!

Creating an armature:
Rigging A Model:

[Optional] Creating Custom Animations
Create 6 Animations, ideally with these frame lengths:
  • Run (6 Frames)
  • Idle (5 Frames)
  • FallNEW (5 Frames)
  • JumpNEW (5 Frames)
  • PlayerDeath (3 Frames)

And export them with the model.
Importing to Unity
When the player is to your liking export the model as an FBX
Import the character into Unity into the root folder, (import any textures):

Setup any materials[docs.unity3d.com] you need, the basic shader I use is Legacy Shaders/Diffuse

For things like one sided meshes where the texture needs to be on both sides I used this[assetstore.unity.com] Asset Package for the shaders to make them look proper in game.


[Optional]
IF YOU MADE ANIMATIONS
On the model Import settings go to the 'Rig' tab and and set Animation Type to 'Legacy':

Go to the 'Animation' tab and under clips rename all the Animations to just the Animation name from above,

and on the bottom set each animation wrap mode to 'Loop'
Making the Prefab:
Import the attached texture, material, and script to your package
Material: Link[cdn.discordapp.com]
Texture: Link[cdn.discordapp.com]
Shader: Link[cdn.discordapp.com]

Click on the texture and set the settings of it as follows, the key settings being the Wrap and Filter mode


Click on the material and setup the material as follows, dragging in the direction of the arrow.

Create a Prefab and name it [charactername]char



















Drag your model into it and set the location to (0,0,0), the location may be different depending on how you modeled it but the general rotation is (0,-90,0)

if the model is in the pose of one of the animations don't fret! This is normal!








For setting up the shadow click on your model and in the top right of the screen change the Layer to anything that is not None, I used TransparentFX

It will ask to set it for all child objects as well, click yes.





Next go to the Heirarchy tab and create a 'New Empty', on the right side Add a new component and search for 'Projector'

Make sure to set the Location to (0,0,0)
And the Rotation to (90,0,0) so it faces straight down on the player

The rest of the settings you will want to set up like so, making sure the Ignore Layer is what you set it to be above.
From there go back to the scene and move the Projector to be above your player, there's no set 100% working height as this will vary depending on the model

Here's how mine is set up, you may need to mess with the ortho size so that the shadow properly covers the model
(yes I'm aware I forgot to set the Material in this picture, it's just the shadow material from the top of this chapter)

To set the animations to be able to be used in-game: click back on the model and add an Animation Component.

(I had lost the original files so please bear with me, everything is the same except for the model, huge thanks to Hubster for letting me use the model!)

Set the Animation to be the Idle Animation,
and then create 5 Elements with each animation (including another idle).


From here we're ready to start getting things exported!
Getting Ready for Exporting
Now that we have everything ready in Unity let's setup the asset bundle for exporting,

It's very important that EVERYTHING we have in our player is all in the one asset bundle, or else it will NOT work.

To create an asset bundle click on any object in the Project tab and on the bottom right of the screen look for the AssetBundles tab, click on it and click 'Create New Asset Bundle'.

There is a known error in which you cannot actually type in the box when it is selected, I don't really know a fix but pasting text works in there just fine,


The AssetBundle will be in all lowercase, this is important, please name your files in correspondance, I will touch over this more in later parts

Once you have the first asset bundle setup click each other object and repeat the process from above, but instead of creating a new bundle just select your bundle from the selection.

Repeat this for every other item you have here (including materials if you made custom ones)
[Optional] Extras:
Everything in this section is OPTIONAL

Character Icon:
To set up an Icon import any Texture 2D and rename it to [charactername]icon.
Set the texture type to Cursor, this is the only fix I have found for the issue of the icon blinking in-game, (even if it doesen't happen with yours other players may cause it to happen later on, better safe than sorry!

Character Movement:
To set up the character speed and movement type create a text file and paste the following,

isHover = false; PlayerSpeed = 20.0; infJump = false;

change the variables to be what you would like
isHover
if the player floats like glitchy
PlayerSpeed
the players running speed (20 is default)
infJump
if the player can infinite jump like Macbat

save the file and name it [charactername]info

Drag and drop this into your Unity file and you're set!

Character Menu Name:
Much like above make another new text info, this time named [charactername]menuinfo
Line one should be the character name, and line 2 should be the description, if you wish for a character "special feature" to take up multiple lines add \n to signify a new line (ex: "cool\n confided\n awesome)
then just add it to the asset bundle like above, and presto!

Character Costumes:
In some levels Toree gets costumes, my setup is a bit different from the in-game one but rather simple none the less.

Create the Costume for your character in the software of your choice and import it into unity, create a prefab and copy everything from your base player prefab over, delete the old model and import the new model in its place. Then rename the prefab as follows -

Prefab Name
Maps it will replace
[charactername]charMyuu
Hidden HQ & Sky Station
[charactername]charPool
Palm Tree Paradise & Sparkle Park
[charactername]charSky
Lunar Lasers & Dash Dimension
[charactername]charLava
Pyro palace & Torch Tower
[charactername]charZwei
It's Home (& the boss level)
[charactername]charWinter
The Christmas update levels

Example of one of my costumes:




Backpack:
In-game Toree has a backpack that whenever he grabs a star or cd it plays a little "grab" animation
to add one for a custom character have the backpack as its own mesh in blender, not rigged to any bones or with any model and import that to unity.


setup the materials for the backpack the same way you did for the player, then drag your backpack mesh into the prefab and align it on the player as you want it to appear in-game.










next drag the backpack ONTO your models desired bone for it to follow (most often root bone or a spine bone), NOT UNDER IT WILL GIVE AN ERROR









from there make sure the mesh is named Backpack, like seen in the pic, and it should work in-game!
Exporting and In-Game
Once all of our assets have been assigned to our AssetBundle we are ready to export it for in-game usage!



On the top of the window hit the tab called 'Window' and open the AssetBundle Browser

This will open a window named AssetBundles (I have a few more Asset bundles, you will only see the one with your [charactername])

Go to the tab that says build and under the 'Advanced' dropdown, set as follows


Click build to build the Bundle, then go to the folder you built it to (if you don't know just click browse in the build tab and copy that folder location)

From here copy the file that is your [charactername], you can ignore the Manifest file, do not copy that


Copy the file into the PlayerFolder folder inside [Steam Location]>Toree2>Mods>PlayerMod>Playermods

Selecting the Character
If all went well then when you boot up the game the character will be selectable and be playable in-game!
5 Comments
sonc 5 Jan, 2024 @ 2:22pm 
I know this is a pretty old guide but I was wondering, even if says optional do I absolutely HAVE to make new animations for the characters or will the game / unity do it for me somehow
Crash  [author] 5 Jun, 2023 @ 10:04am 
They’re on the nexus mods workshop page, unfortunately due to me swapping pcs a bunch of times things dev wise have stopped working so I was sort of forced to stop developing this and other stuff
Wohao 5 Jun, 2023 @ 7:58am 
are there any custom playable characters that you've made and released to the public? like can I download amogus or petah?
Crash  [author] 6 Feb, 2022 @ 4:26pm 
Download BepInEx 5.x x64 unzip in the root of the toree folder, then add the mod folder into the plugins folder in the bepinex folder
Crash  [author] 6 Feb, 2022 @ 11:38am 
did you download bepinex?