How to activate a button in first person view?

Hi all!
I’ve been messing around playcanvas for a few days and I think I’m on track with how to create a first-person painting/poster gallery.

But what I’ve missed, even though I went through the forum and tutorials, is how to activate a button in the first-person view. I.e. you click on the cart and the button activates and adds an item to your cookies, click on the register and you toggle the payment/order HTML to view.

Would anybody happen to have any pointers?
Cheers and thanks in advance :slight_smile:

Is the button in the game world or a UI button for the use to click on with the mouse pointer?

It’s in the game world.
Naturally touch works without problems. I can activate a script when on mobile, but desktop needs to release cursor by ESC, and then click.

You can make it so that it doesn’t lock the cursor, and instead you just have the player hold down the mouse button and drag around the screen to move the camera around.

If it’s in the game world, can you user press a keyboard button to ‘use’ the in game world button when they are close to it?

This.

I really like the Look-Camera for this kind of stuff :bearded_person:

Then again, there is no walking around in this example. Might as well try to figure out the camera lock :stuck_out_tongue:

1 Like

Rethinking on this, you can look at the button in first person mode and click to use it

Wow. Thank you all for the quick replies.
Yes, I’d like to look and click, but I have no idea how.
You can get an idea of what I’m doing by taking a look at the playground here https://playcanv.as/p/DEZ3xZJ3/

Thank you all. This is a nice community :slight_smile:

1 Like