Used to set a string value. On a FSM, click on the bottom-right “Action Browser” button. Choose “Set fsm string” action. Input the variable name that you want to set up in “Variable name”. Input the wanted string in the “set value”. Even if this action seems to be self-explanatory, there is a huge mistake […]
Recipes
DontDestroy object to keep variables

How to keep some variables loaded when you change scenes or restart scenes ? You can of course save it local on disk, but there’s more simple solution if it’s just some variables that don’t need to be kept forever (as player current health, that you need to keep when starting a new level) You […]
quick method to destroy game objects by time

In some cases you’ll want to destroy a game object by time. For this purpose you can use a little script like this one that you can attach to any object, as soon as you fill the lifeTime value in the editor, the gameObject will destroy itself within the given time. public class destroyByTime : […]
Adding particles with campfire exemple

Add a particle system : Right click / Effects / Particle system. A default particle system is created and plays in the editor. You can now see floating white particles, because the default material is white. You can modify the various parameters in the inspector and see the results live in the editor. Particle […]
create a new material

First make sure we’ve created a folder “Materials” just for organisation purpose : Right click on the asset window / create/Folder/ name it Materials. Then, right click /Create/Material/ then name your material
Add animator condition

When you have created at least one parameter in your animator, you can add conditions. By clicking on a transition arrow in your animator view you’ll see in the inspector window a “Conditions” Tab. Add a condition by clicking on the “+”. It will automatically fills the condition with your only parameter available, or give you […]
Add an animator parameter

In the Animator window, Under the “Parameters” tab, click on the “+” Choose the type of wanted parameter to add : Integer, Boolean, Float or Trigger. Give a name to the parameter. Animator parameters are useful for setting and changing animation states on the fly
Animating Sprites

estimated time : 7 mn ingredients needed : Unity, Playmaker (this recipe is part of the footvolley game menu ) Detailed Steps Sprite sheets. Slice a sheet in the editor mode. Create an animation. Looping an animation. Making transition between animations. Moving between transitions by script. What is a sprite sheet ? A sprite […]
Converting an image as a sprite

Convert an image as a sprite By default you cannot use any image to be displayed with the “Sprite Renderer” component. Select your image in the asset folder. On the Inspector window on the right set the Texture Type as “Sprite”. Click on the “Apply” button at the bottom right. Displaying the sprite Then you […]
The Resources folder

Resources folder Create a folder called “Resources” in the asset folder. What is it used for ? The resources system is used in Unity to load and unload Objects at runtime. Recommendations Unity strongly recommend NOT TO use it, mainly for performance purposes as it can increase the startup time and the length of builds; […]