Controlling Objects by Forwarding Player Input

Any object or group in the Blocksmith Builder can be controlled by the Player using Events. This simple transfer of the player's input opens up a vast multitude of possible games and experiences, since you are no longer tied to a First-Person-View. Here are several ideas:

  • 3rd-Person View Games
  • Controlling any type of Vehicle
  • Fully 2D Games
  • Rouge-like 2.5D Games
  • Many More!

How to Forward Player Input

  1. The first step to forwarding the Player's input to an object is to find and select the Player in a scene.
  2. Add the following event to the Player:
On: Update
Then: Other Object (select the object or group you want to control)
Send Player Input

ALT TEXT HERE

  1. Select the object or group you want to control and then add the following event:
On: Received Input

ALT TEXT HERE

  1. Now you get to decide what type of movement you want to detect! Do you want to know when the player moves horizontally, or maybe only when they jump? Here is a breakdown of how detect and transfer the Player's movement:

Move Forward

On: Received Input
& If Player Move Z > 0

The event condition detects whenever Players move forward, towards the positive end of the Z-axis. Pair it with either of the following event actions to move an object "forward".

Pro Tip: Applying a Relative Force on the car's Z-axis is required to make it move "forward" even when turned around; you can see an object's forward vector while rotating it. Applying a standard Force will always move it in the same direction.

Then: Myself
Apply Relative Force (requires Physics)
X: 0
Y: 0
Z: 50

Or

Then: Myself
Move Locally By (Physics not required)
X: 0
Y: 0
Z: 100 (cm)
Duration: 0.2 

ALT TEXT HERE


Move Backward

On: Received Input
& If Player Move Z < 0

The event condition detects whenever Players move backwards, towards the negative end of the Z-axis. Pair it with either of the following event actions to move an object "backward".

Pro Tip: Hold down the X or Z keys while editing in the Builder to see the direction of the X and Z axes respectively.

Then: Myself
Apply Relative Force (requires Physics)
X: 0
Y: 0
Z: -50

Or

Then: Myself
Move Locally By (Physics not required)
X: 0
Y: 0
Z: -100 (cm)
Duration: 0.2 

ALT TEXT HERE


Move Right

On: Received Input
& If Player Move X > 0

The event condition detects whenever Players move right, towards the positive end of the X-axis. Pair it with either of the following event actions to move an object "right".

Pro Tip: To have a car or vehicle "turn" right, rather than move right, add a extra Physics event action to apply Torque on the Y-axis of the car while also moving forward.

Then: Myself
Apply Relative Force (requires Physics)
X: 50
Y: 0
Z: 0

Or

Then: Myself
Move Locally By (Physics not required)
X: 100 (cm)
Y: 0
Z: 0
Duration: 0.2 

ALT TEXT HERE


Move Left

On: Received Input
& If Player Move X < 0

The event condition detects whenever Players move left, towards the negative end of the X-axis. Pair it with either of the following event actions to move an object "left".

Then: Myself
Apply Relative Force (requires Physics)
X: -50
Y: 0
Z: 0

Or

Then: Myself
Move Locally By (Physics not required)
X: 100 (cm)
Y: 0
Z: 0
Duration: 0.2 

ALT TEXT HERE


Combine All Four!

Now try adding all four movement commands to move the car/group you are controlling in all four directions!

ALT TEXT HERE



Look to Move

Another way to control an object's movement can be with your view! On computers this means moving the mouse cursor, but in VR it means where you are looking!

Pro Tip: If you are using Physics forces, try changing the object's Physics Material properties like Friction to make it glide much smoother.

To have an object move horizontally as you look left and right, add the following events:

On: Received Input
& If Player View X > 0
Then: Myself
Apply Force (requires Physics)
X: 50
Y: 0
Z: 0

On: Received Input
& If Player View X < 0
Then: Myself
Apply Force (requires Physics)
X: 50
Y: 0
Z: 0

ALT TEXT HERE


Click to Jump

Use the mouse buttons (or controller triggers in VR) to get the object to jump! Do do so, use the "Player Trigger" events. To understand them:

Player Trigger 1 = left mouse button, or main trigger in VR
Player Trigger 2 = right mouse button, or secondary trigger in VR

And the numbers you input mean:
0 = Mouse/Trigger is not pressed
1 = Mouse/Trigger is pressed

So to detect when the player click the main mouse button (or trigger in VR) and have the object "jump", use the following event:

On: Received Input
& If Player Trigger 1 = 1
Then: Myself
Apply Force (requires Physics)
X: 50
Y: 0
Z: 0

ALT TEXT HERE