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.
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.
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
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.
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..
Create a new [Camera] and name it so you know what it’s doing, “Camera_UI_”.
Change the cameras “Clear Flags” to “Depth Only”.
Remove all layers except the “UI” layer from the “Culling Mask” are on the new camera you just made.
Set the Cameras “Depth” to “100”.
Remove all ‘Non-Camera’ components from the new camera. For example “flares’ and ‘audio listeners’.
On the main Canvas, change the “Render Mode” to “Screen Space – Camera”.
Assign the new “Camera_UI” camera to the “Render Camera” area of the Canvas.
Remove the “UI” layer from the “Culling Mask” of the Main Camera.
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.
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.
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.
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.
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)
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.
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:
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:
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.
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.
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.