How to create ‘Dy*asty Warriors’ VR with STYLY and Unity’s Playmaker Vol.2 ~ ‘Look At’ and ‘Collison Enter’

In this article, I explain how to create the motions of the enemy character and detect the collision.

We keep the enemy character getting close to you (i.e. the player) no matter where you are.

Then, we make the enemy character disappear when you hit it with your sword.

Please read the previous article to see what’s implemented so far.

The previous article: How to create ‘Dy*asty Warriors’ VR with STYLY and Unity’s Playmaker Vol.1 ~ Animation and Random Spawn



The completed scene


View the sample asset by WebEditor

View the sample asset by WebEditorLaunch the WebEditor

※If you have your STYLY account, you can view the sample asset created in this article by WebEditor.
If you don’t, create a new STYLY account and then press the button above.

You can create a new STYLY account >>
Click here



You can taste the sample space from STYLY GALLERY.

Gallery Page

You can download the Unity project introduced in this article.

Sample Project


Required assets

We use Playmaker and Move Motion Free Pack.


We use Playmaker.


Move Motion Free Pack

Move Motion Free Pack

The setting for the character

Add Components

Add ‘Rigidbody’ and ‘ Capsule Collider’ to detect the collision when the character is attacked.

With the ‘Nakagawa’ prefab selected, add the components.

Uncheck the ‘Is Kinematic’ in the Rigidbody component.

Uncheck the ‘Use Gravity’ box.

Uncheck the ‘Is Trigger’ in the ‘Capsule Collider’ component.

Adjust the Center, Radius and Height value to fit the capsule collider to the body shape.

RigidbodyとCapsule Colliderの追加

Add the ‘Rigidbody’ and ‘Capsule Collider’ component


The setting for ‘State’

Select ‘Nakagawa’ in the Prefabs folder and add an FSM to it.

Right-click on Playmaker Editor and select ‘Add State’ to create a new state.

Get the Main Camera to store the player in VR.

Add the ‘Get Main Camera’ component.

For the ‘Store Game Object’ field, create ‘MainCamera’ by ‘New Variable’ and select it.

Get main Cameraの追加

Add the ‘Get main Camera’ component


Add the ‘Look At’ component to keep the character facing the player.

Set ‘MainCamera’ for ‘Target Object’.

Check the ‘Keep Vertical’ box.

Look Atの追加

Add the ‘Look At’ component

It makes the character face the player (MainCamera).


Next, we make the character get closer to the player.

We use ‘Move Towards’ this time.

Select ‘Maincamera’ for ‘Target Object’.

Check the ‘Ignore Vertical’ box.

Set the ‘Max Speed’ value to 2.

Leave ‘Finish Distance’ set to 1.

If you set ‘Finish Distance’ to 0, the character would move to the position of ‘Target Object’. You can make the character stop short slightly by setting it to 1.

If you set it to a larger value, it stops at a farther position from the target.

Move Towardsの追加

Add the ‘Move Towards’ component

Now we have created the character that keeps moving to the player.


Add the ‘Collision Event’ component to detect the collision.

Select ‘On Collison Enter’ for ‘Collision’.

Select ‘System Events > COLLISION ENTER’ for ‘Send Event’.

Collision Eventの追加

Add the ‘Collision Event’ component.


Add the state to destroy the object when it collides.

Add the ‘Destroy Self’ component to destroy the object by itself.

Destroy Selfの追加

Add the ‘Destroy Self’ component.

All settings have been finished now.

After this, you just need to upload the ‘STYLYmusou’ prefab created in the previous article (Vol.1) to STYLY and place it in a scene.


How to upload an asset from Unity to STYLY.
Read the article

In this article, I explained how to control the direction in which the character moves and detect the collision by using Playmaker.

I introduced how to create a game like ‘D*nasty Warrier’ in those two articles, Vol.1 and this Vol. 2.

I think this type of game gets along with VR very well, so I want to elaborate this game a lot more.

You can make it more impressive by adding the motion reacting to the enemy’s attack, sounds and effects.

It’s a nice idea to publish the VR game with your scanned avatar used.


The 3D model used in this article can be found in the sample project.
Only in STYLY, you can use this 3D model.
As long as you use it in STYLY, you can modify it without any restrictions.