Root Motion Animation is missing a gravity setting and will result in an animated object that floats down rather than falling. The Animation needs to have the “Curves” variable added and set to 1.

Yes it needs to be “GravityWeight” not “gravityWeight” like the documentation says.

Go into each animation used and add a “Curve” with the name “GravityWeight” and set the value to 1, and then click on the curve and choose the Strait line option from the bottom. Hit Apply and the gravity issue should be solved.

Mesh Collider goes on feet or wheels
RigidBody goes on the Parent Transform

NOTE: The center of Mass will be calculated based on all of the colliders on the object so strategically placing colliders for correct center mass needs to be considered.

Here is a major update to the SQLite in Unity that support show to access an SQLite database in Unity using only Bolt.

For this to work you need to have SQLite setup in Unity already, and a database created inside your projects “Assets” folder.

This example connects to the database and asked for all of the “gamename” entries in the database table called “games”.

SELECT gamename FROM games

The data is returned to Bolt and accessed using A “Data Record Interface” that lets us put the returned values into a list.. (here we only process the result of 0 or first field of the array of returned results) resulting in a list of game names retrieved from the database.

Note: The DB_Results ‘Scene Variable’ that is storing all of the names of the games pulled from the database results is set to be a ‘List of String’.

If we changed the query to ask for the gamename and genre we would then need to process index “0” and “1” [0 = gamename & 1=genre] for each result.

SELECT gamename, genre FROM games
Click for a larger view of the graph.

There are a few extra “Assembly & Types” that need to be added to Bolt for this to work. Due to the project i was working on not all of these may be needed but you should be able to understand which ones are SQLite oriented.

Mono.Data.Sqlite, System.Data (For Sure)
Sqlite Command, Sqlite Connection, Data Record Interface (For Sure)

IMPORTANT WHEN BUILDING

You need to set the Player API Compatibility Level to “.NET 4.0” in the “Other” Settings and you need to copy the “System.Data.dll” and “Mono.Data.Sqlite.dll” files from your Unity install folder and put it in your projects “Plugins” folder of the build will fail.

Example Install folder for system.data.dll location: “C:\Program Files\Unity\Editor\Data\MonoBleedingEdge\lib\mono\unityjit”

I wanted to make note on how to do this because I purchased specializes VFX for the canvas which wasn’t needed at all after learning this little trick.

To have any Particle or sprite-based VFX show on your GUI Canvas in Unity you can simply create a special camera to do it. I though that having an extra camera was complicated, a waste of time, and would lead to more work to get things to look right in the long run…nope!

Here are the steps to getting this working..

  1. Create a new [Camera] and name it so you know what it’s doing, “Camera_UI_”.
  2. Change the cameras “Clear Flags” to “Depth Only”.
  3. Remove all layers except the “UI” layer from the “Culling Mask” are on the new camera you just made.
  4. Set the Cameras “Depth” to “100”.
  5. Remove all ‘Non-Camera’ components from the new camera. For example “flares’ and ‘audio listeners’.
  6. On the main Canvas, change the “Render Mode” to “Screen Space – Camera”.
  7. Assign the new “Camera_UI” camera to the “Render Camera” area of the Canvas.
  8. Remove the “UI” layer from the “Culling Mask” of the Main Camera.
  9. Finally, on any VFX you need to change the “Layer” to “UI”, so you may want to create a special prefab, so that it doesn’t mess with any of the VFX being used in 3D Space normally.
Example of Camera_UI
Main Canvas Example
VFX for UI Example

UPDATE: If you are finding that the effects are being clicked by the UI you can make a third camera for just the effects and Set it’s depth to 100 and then depth of the UI camera to 99. Now all of the VFX need to be put on the Effects Layer (Yes you need to create yet another layer, but the result is amazing and worth the effort.)

Wanting to create a pinball minigame I needed to create realistic pinball flippers, which were the second most important step after learning how to setup the gravity to make the ball move realistically. (Which I will also add into this note for future reference.)

Because Hinge Joints internal springs aren’t a simple variable and a part of a ‘struct’ which needs all of the variables set at once and then have them applied to the spring all at once. (I know right, If I had hair I would have ripped it out building this Graph because it didn’t follow the rules I was use to using.. damn structs.

In order to access the “Joint Spring” inside the “Hinge Joint” we need to add it to the Bolt Type Options.

Add Joint Spring to the Type Options in the Bolt Setup Wizard.

Before we get to the graph I want to explain what it’s doing and why it acts differently then setting other component options, keep in mind the struct thing we mentioned above.

We need to first get the Hinge Joint when the program starts. We then get the joint spring that it’s using. Then we create a new spring. Next we apply all 3 variable changes to the new spring, and then replace the old spring with the new one.. applying all of the changes we wanted to the three options of ‘spring’, ‘damper’, ‘target position’. (What a long way around.)

Here is the Graph with a left and right pinball flipper that flip up 45 degrees when the correct input is pressed.

Click for a larger view.

We setup variables for spring and damper so that we could change them quickly for testing but if you are getting this advanced in bolt you should be able to understand what this graph is doing.

Pinball Gravity

As a bonus here is how we setup the pinball gravity for this scene and set it back in other scenes so each scene can have it’s own gravity since the project that this is for has multiple mini games.

Default Gravity so we can re-use this code to set the gravity back to default.

I’ve ordered a bunch of these Pandora’s Box systems and the “Pandora 3D Game+ Wi-Fi” has options for adding games by a build in game shop as well as adding games by USB stick. I wanted to empty out the entire XD card and only add the games I wanted because there were so many games with wrong names and so many junk games it was a waste of space.

To do this I needed to edit the SQLite database and learn the internal variables and folder structure. I wanted to make note of this research here for future reference and because it may help someone else some day.

When add in the games via a USB stick you need to use the “External Game Manager to add the games to the correct emulator. The only problem is that when you are given the option to choose the emulator for the game you are adding you need to have a keyboard attached to the Pandora’s box because the joystick up & down don’t work.

Here is the list of the emulators you are given to choose from (in order that they are listed on screen)

  • FBA08
  • FBA42_ORI
  • MAME37
  • MAME139
  • MAME78
  • FBA42
  • PPSSPP
  • PS
  • N64
  • FBA42_FMY
  • FC
  • SFC
  • GBA
  • GBC
  • MD
  • WSC
  • PCE
  • DC
  • MAME19
  • MAME139
  • MAME199

When adding games this way you will not have any preview videos when viewing the game in the games list. You may be able to add an .MP4 with the same name as the rom onto the USB stick, but I haven’t tried it. “PNG, JPG” don’t work as a simple screenshot, it seems to want an MP4 only.

Game.bd Database Information

Table – “info”

  • CREATE_ID – Auto Generated (Shows games in this order)
  • ROM_NAME – name of the rom file
  • DEFAULT_DISPLAY_NAME – Name of the game
  • EMULATOR – The emulator use to run the game
  • GENRE – used to searching by category
  • LOAD_TIME – (0-50000)
  • COIN_DURATION – (0-250)
  • DEFAULT_CONFIG – (NULL,4_.zip,4_2.zip,4_3.zip,_.zip,_2.zip,_3.zip)
  • SUPPORTED_FEATURES – (null,4[exit only],5,20[exit only],21,23[exit only],28[savestate],29,30,31[savestate])
  • COIN_INSERT_MODE – (0)
  • FLAG1 – (NULL, 0,1[n64])
  • FLAG2 – (NULL)
  • FLAG3 – (NULL)
  • EXTERNAL – (0,1)

Table – “display_name”

  • ROM_NAME – Name of the rom
  • LANGUAGE – (KO,ZH,EN,ZH)CN, JA)
  • LOCATE_DISPLAY_NAME – Localized Name in chosen language

Table – “option”

  • ROM_NAME – name of the game rom
  • HIDE – (1) 1 seems to equal “don’t hide”
  • TOP_ID – (0)
  • CURRENT_CONFIG – (NULL,4_.zip,4_2.zip,4_3.zip,.zip,_2.zip,_3.zip) TARGET_CONFIG – (NULL,4.zip,4_2.zip,4_3.zip,_.zip,_2.zip,_3.zip)
  • PLAY_ID – (0,1,2,3,4,5,6,7,8,9,25[pce?]) Default=0
  • KEY_COMBINATION – (0)

EMULATOR # Information

  • 1 – ???
  • 2 – Arcade (mame37)
  • 3 – Arcade (mame139)
  • 4 – Arcade (mame78)
  • 5 – Arcade (fba42)
  • 6 – PSP (family)
  • 7 – PSX (family)
  • 8 – N64 (family)
  • 9 – *KOF (family) snkplaymore
  • 10 – Genesis (fba42)
  • 11 – NES (FC)
  • 12 – SNES (SFC)
  • 13 – GBA (GBA)
  • 14 – Gameboy Color (GBC)
  • 15 – MegaDrive (MD)
  • 16 – Wonder Swan Color (WSC)
  • 17 – PCE (PCE)
  • 18 – Dreamcast (DC)
  • 19 – Arcade (mame19)
  • 20 – *Arcade (mame139) retro_Arch
  • 21 – Arcade (mame199)

GENRE # Information

  • 0 – Other
  • 1 – Fighting
  • 2 – Action
  • 3 – Shooting
  • 4 – Sports
  • 5 – Puzzle
  • 6 – Racing

Lerp movement and rotation is a quick way to animate game object movement in Unity. Here is a Rotational Lerp in Bolt. This example shows how to rotate a pinball flipper when a button is held down and then puts it back to it’s original position after the button is let go.

It’s important to note the use of Input.GetButton which relies on the variable name used in the unity Players button mapping. This will return true or false depending if the button is held down or not.

Also the mix of Vector3 and Quaternions can get messy, which is why we use Euler angles here, because it converts Vector3 into Quaternions.

There are Graph-Variables show for the alternate flipper in this image as well so don’t let that throw you off when reading this Graph.

Update:

We went with Hinge Joints to use the built in Unity Physics. However we did use Lerp to animate player pieces moving around a board game board from square to square. It just didn’t feel right for pinball flippers.

Dropping loot from enemies in any game should have an element of wonder, and to get that loot should be randomized and have a common to legendary drop rate, making it harder to get certain items.

I wanted to make this loot system simple to build and easy to populate. It allows for you to create and generate drops based on rarity and loot tables so enemies can have custom drop lists.

The entire system in two super units on a single Bolt graph. The Unity Event and Debug Log are just to help show the system working and are not needed.

In this example we are using only one Drop List and have linked it to all of the rarity slots on the Loot Drop super unit. Ideally you would want to create a drop list for each of the rarity slots on the loot drop super unit.

If you wanted some items to drop 100 percent of the time you would attach that Drop List to the 100 Percent node. If you had a super rare list of item that should only drop 1 percent of the time you would attach that Drop List to the 1 percent node.. and so on for all of the percentage nodes.

This is an extensive loot drop system, you can cut back on how many percentage nodes you have and then amount of items available to be dropped in the Drop List to make it scale to a game with less loot options.

MWMDragon (This is based on MMO loot theory.)

A look inside the first super unit:

There must be a graph variable created to store these items here it’s called ListOfLoot.

This first super unit takes the 10 game objects that you drag and drop into the drop list slots and processes them into a list of game objects. If any of the drop item locations is left empty or if you only assign loot to a few random location, it takes that into account and still builds a list with no chances of an empty loot slot, preventing any errors right from the start. This loot list is then sent to the second super unit.

A look inside the second super unit:

Top half of the super units graph.
Second half of the super units graph.

This second super unit generates a random number between 0 and 100 and calls the right ‘percentage node’ to drop loot from. It them grabs the list of items in that percentage range and randomly chooses an item from that list of loot objects. It then takes that loot object and sends it out of the super unit to be sent to the Console window. This is where you can choose what to do with that loot drop in your game.

The Loot drop happened when I clicked the button in the middle of the screen showing that loot was indeed dropped.

(Look at the console window)

There you have it a Loot Drop system the relies on Loot Tables and a percentage chance of dropping certain items for your game. Is this the best and only way to do it, no, but this is my way of doing it.

I’ve found an easy way to create these timers in Bolt, they come in handy for many kinds of games. The timers start and stop with bool variables and updated a text with the current time counts.

Count Down Timer

The count down timer starts when the Countdown_Timer_Running variable is set to true the timer starts counting down from the Timer_Count_Down integer variable which is set in seconds (120 = 2 minutes). When the timer hits zero it stops running.

Stop Watch Timer

The Stop Watch timer starts when the Stopwatch_Timer_Running is set to True. and start counting up in seconds storing the full time passed in the Stopwater_Time Integer variable.

I do this quite often but why not just put a quick reference to raycasting in Bolt, right here, right where I can find it easily. Maybe even free up some of the limited memory in my head 😉

When the player clicks the mouse button on an object it checks if the object has the tag “Things” and if it does then you just need to extend this graph using the “True” pathway to make it do something.

Communicating scores and other information to PHP from within Unity is needed to enjoy an interactive experience in the way I want to offer it. Unity changed the back end of the WWW communication system and I figured since I need to relearn it, I could use Bolt to make it an easy rebuild in the future.

A few strings are sent to the PHP script as variables.

There will be more to this soon as I work more with it, I just wanted to be sure to document a working graph.

Any PHP script that this interacts with must have the proper headers or the code will do nothing.

<?
header("Access-Control-Allow-Credentials: true");
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, OPTIONS');
header('Access-Control-Allow-Headers: Accept, X-Access-Token, X-Application-Name, X-Request-Sent-Time');
?>