Forgot password?
 立即注册
EasyAR Portal Tutorial View Content

EasyAR + Third-Party Developing Series(1)--Model Control

AlbertLee 2017-8-16 10:36

Model Control

We can develop many applications with EasyAR SDK and Unity. In this tutorial, we share how to achieve common AR functions via Virtual Controls and EasyAR.

Achieved Function:

1.After recognizing the target, click on the task and activate the button and play the animation and particle effect. Related UI model display.

2. Joystick can achieve moving and attacking effect.

Similar Effect:




EasyTouch :https://drive.google.com/open?id=0B6vjKDkZUGVsSF9WNk5YUk9udE0

Resources: https://drive.google.com/open?id=0B6vjKDkZUGVsR3FOQllTR25oM0U

Model : https://drive.google.com/open?id=0B6vjKDkZUGVsaFhoWi1PcGpMZ0U


Step 1:Developing Environment

We develop this function based on HelloAR. Import HelloAR Samples from our official website into Unity.



And then we import prepared model, particle effect and plug-in into Unity, like that:


Open HelloAR Scene, delete all ImageTargets and keep one(For testing convenience, use identification card for image target)


Apply Key from official website and fill in the key.Replace Cube with model.


Modify the parameter of Transform. I change them into that number and you can make a reference:


Step 2:Use Easy Touch

Right click on Mouse and create Joystick


Like that: 



Note: Here I changed its texture to make it more intriguing. I offered link for texture resources in the beginning of this tutorial and you can choose one that fits your needs.


Modify Turn & Move direction Action and drag animated model into Direct action to 

You can also change its parameter for motion speed and model 

Next, we create Button (for attacking operation when clicking)


Move button into the right corner and you can also change its texture. The effect is like that:


Step 3:Modify Animated model

At first add Box Collider for model


Create script Payer. At first click on activating the animated figure and use OnMouseDown() to achieve that:

At first, we set up model animation:



In order to achieve perfect interactive effect, we can click on the model for activating the model. We don’t display Joystick and button so we add them based on the original code:


Then assign GameObject Joystick and button into the code.

At last, click on attacking button and play the animation

Add particle effect based on the original code like that (note: We introduce another particle effect PART 2 and you should define it in class and select your particle into the code)

At last, we create Skill1 for the Button.