Use EasyAR SDK to develop fun applications

Part ONE: Preface

EasyAR development and Learning: 605785368

In the last chapter, we realized the interaction between finger and AR model of Fire Man. In this class, I plan to teach you how to click the AR model on the screen to move to a specified position.

Preview (PS: FOR development purposes, I did not use the model in the video demo and will only share my own implementation) :



See + demo

Part TWO: Preparation before development

Links to related resources: monster model: : https://pan.baidu.com/s/1nv165mD password: s8s6

Here, I will only provide my own implementation method, of course there are many ways to achieve this effect.

First, let’s create a plane and change the size to (2,2,2).










Then, next, change its Tag to Ground






The most important part is to turn off the Renderer so that it doesn’t show, so in this case we just want the Mesh Collider










Part three: Writing code

First of all, we will create a script in the AR model, here we use the ray detection method to achieve.

Get input.gettouch (0). Position, touch the position of the phone, and then perform X-ray detection to achieve movement. The complete code is as follows: