Moving an object in Universal AR with Unity

I have a button enabled that seems to register “touch” as it flickers when touched. I have written a movement script and added it to my game object, then created an Event Trigger in the button properties… Which type of trigger would you need to select when using a button in WebGL?

I tried pointer down and added the game object to it, but when I looked for the method from the script, it wasn’t visible (despite being “public void” with no parameters.

So…am I going about it in the right way or should this be done in a different way? Thanks!

image

There isn’t a special WebGL button. It’s all the same.
I would need to see your code to know why it’s not showing up.

Steve

1 Like

I’ll have another look myself, just good to know am going in right direction - thanks! Which of the event types would it be? Is pointer up/down the equivalent of tapping a button with your finger?

Ok so my code is in a script that’s attracted to my canvas.

From there I just click the “+” to add to the on click list.
You will get a new item in the list with 3 boxes.
Runtime only, None (Object) and No Function.
I drag the Canvas from the Hierarchy to the None (Object).
In my script that is attracted to my canvas I have a public function I want to run.
Now in the No Function list you will see the name of the script and in that you can find the function you would like to run.

Steve