top of page
Search

Bolt Tutorial I - 2D platformer

  • esb690
  • Apr 27, 2022
  • 2 min read

I used the above video tutorial today. Below are my notes:


Bolt Tutorial I


Creating variables in the object tab provide scope relative to the entire game object.

Integer - Whole numbers without decimals

Float - Numbers containing decimals


Variables created in the graph tab the variable can only be viewed/manipulated in the flow graph.


Flow Graphs contain gameplay logic.

The Start Unit runs once when the Flow Graph is initialized.

The Update Unit will run continuously, as long as the game object is active.

The Graph Inspector shows details of units entered into the Flow Graph.

To Disconnect a Port, right click.

To create Visual Groups with Custom Labels, press ctrl and click and drag.


Creating movement for the player character:


The Get Axis unit will allow the player character to respond to the keyboard. It will produce a value between -1 and 1 based on the key presses associated with the horizontal axis (typically the A and D keys).


The Speed object variable can be dragged and dropped into the flow graph. Using a Multiply Unit, the speed variable is multiplied by the value from the Get Axis unit and assigned to the movement variable.


The Update unit is connected to the movement variable’s input port so that we get the Input Axis’ horizontal value each frame.


In the Editor, on the player object, Rigidbody 2D is responsible for applying physics to a game object. In Bolt, we use the Rigidbody 2D: Get Velocity unit and connect the output to a Get Y unit to get the Y value of the velocity of the player object. Then we use the movement variable and the get Y unit as inputs for a Create Vector 2 unit, and output the vector values to a Rigidbody 2D: Set Velocity unit. Then, the calculated movement variable from earlier is plugged in to the Set Velocity unit’s input.


When we connect the Update Unit to the Set Variable and Set Velocity units, Bolt executes the logic associated with both units. In play mode, we can see logic being executed in real-time, which for the Update Unit is once per frame.


Creating animation for the player character:


In the editor, there is an Animator component attached to the player object. Double clicking on the controller within this component will show the preset animation states.


In Bolt, we start with the movement variable again, and connect it to the input of a Comparison unit. This allows us to connect numeric values with sprite states. For example, looking right is 1 and looking left is -1. See below for logic:


For some reason, when I started to move, the level and my character disappeared. All I can see is the background. I checked it against the tutorial a few times and couldn't find the discrepancy. This didn't happen before I started creating the animation. I'll continue tomorrow and try to fix this.




 
 
 

2 Comments


Angel Martin Palomares
Angel Martin Palomares
Apr 29, 2022

When it comes to characters disappearing did you make sure that the Z axis were set to zero? I know I had the same issue before and that was my fix

Like
esb690
Apr 29, 2022
Replying to

It turned out that in the Vector 3 unit in the second screenshot above, I was supposed to set Y and Z to 1. The guy in the video was going so fast and skipped right over that step.

Like
Post: Blog2_Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Eli's Media Project. Proudly created with Wix.com

bottom of page