Slowmotionアイキャッチ01

How to make a scene with slow-motion effect by Playmaker for Unity ~ vol.1

In this article, I introduce how to make a slow-motion effect in STYLY’s VR space by Playmaker for Unity.

It involves the operations by the mouse and the controller of HTC Vive.

完成データのプレー動画

The completed image

The completed state is shown above.

Only when you keep the trigger pulled, the slow-motion effect is activated.

Confirm sample assets with WebEditor

Confirm sample assets with WebEditor
Launch the WebEditor

* If you  register STYLY, you can check the sample assets created with this TIPS with WebEditor.
If you do not register an account, please register again and click this button again.

Register for account from here
Click here

 

Sample

You can taste a sample space in STYLY GALLERY.
Slowmotion_Sample

You can download the Unity project shown in this article.
Slowmotion_Sample

As this project data doesn’t include some plug-ins needed, install them by yourself.
Playmaker
SteamVR Plugin

Playmaker and Steam VR Plugin

Download the both from Asset Store to use in Unity.

Playmaket in Asset Store

Playmaker is a paid asset.
Playmaker

 

Steam VR plug-in

Steam VR is free.
SteamVR Plugin

 

Make a Bullet

I add a bullet to visualize the motion.

A sphere as a bullet

Rename the Sphere “Bullet” and scale it by 0.1 in x, y and z.

 

Open Playmaker Editor with the bullet selected.

Add FSM

Select “Add FSM” from right-click context menu.

 

Rename the FSM

Now a State has been created.

I renamed FSM “Bulletspeed”.

 

Next, add actions to the Bullet.

Add actions

Click  “Action Browser”.

 

Select actions from “Action Browser”.

Selecting Translate under Transform section in the Browser, click “Add Action To State”.

An action has been added.

 

Set the speed of the bullet.

The setting for “Translate”

I set Z to 7 in this example.

 

Make it a Prefab

Make it a Prefab.

Set a spawn point for the bullet

Make a cube with the name, “Bulletspawn”. Uncheck the box of Mesh Renderer.

The setting for “Bulletspawn”

 

I also add an FSM to the Bulletspwan by Playmaker.

Action Browser for the Bulletspawn

Add “Find Game Object” by “Add Action”.

 

Find MainCamera

Select “Main Camera” from “With Tag” to find the objects with the tag, “MainCamera”.

 

Create a new variable

Create a new variable by “New Variable” and store it to the found object.

 

Create a variable and store it.

I name the variable “Main Camera” in this example.

 

Create a State by “Add State”.

State2 is added.

 

Add an action, “Look At” in “Transform” section.

Add a “Look At” action

 

Set “Target Object”.

 

Set Target to MainCamera.

Set the target of “Look At” to MainCamera I created earlier, and uncheck the box of “Keep Vertical”.

 

Set Transition of State1 to Finished.

Set Transition to FINISHED.

 

Then, connect it to State2.

Connect it to State2.

Next, create Stage3 and add the Action, Create Object.

Add the Action, Create Object.

 

Specify the object to create.

Add “Bullet” and “Bulletspawn”.

Set Game Object to “Bullet” and Spawn Point to”Bulletspawn”.

 

Add “Send Event” and set Transition to FINISHED.

Add the action, “Send  Event” and set Transition to FINISHED.

Connect State2 to State3.

Connect to State3.

 

To make an iteration, connect Stage3 back to Stage2 as well.

Connect State3 to State2.

 

Add “Wait” to shoot every one second.

Add “Wait”

I set the interval to one second.

Set “Finish Event” to FINISHED.

 

In this state, the bullet never stops so “Destroy” it at a suitable point.

Set Destroy and Delay

Set “Destroy Object” to Bullet and Delay to 4 seconds.

 

This article introduced how to create bullets automatically by Playmaker for Unity.

I will introduce how to implement a slow-motion effect on it in the next article.

Next article >>
How to make slow-motion effect by Playmaker in Unity_vol.2

How to upload an asset from Unity to STYLY
Read this article