Picker help

Hi everyone, just wanna ask if we can have multiple conditions for picker.js? i.e I want each clickable asset to have a different function when clicked? thanks in advance

https://launch.playcanvas.com/1570449?debug=true&version=1.56.0

Hi @Genesis_Miranda,

You can do that, you will have to update your code to handle that by adding these conditions. The PlayCanvas engine API will provide the picked mesh instance, from there you can find the entity and add your conditions.

This example illustrates that:
https://developer.playcanvas.com/en/tutorials/entity-picking/#frame-buffer-picking

1 Like

can we also use a controller with the picker.js? in mobile

If you implement a controller input script to work with picker.js, yes sure.

okay, so our default first person won’t work automatically in mobile? with the picker? need to update the picker.js for mobile? thanks

do we have any sample projects with these inputs? sorry I have no idea yet how to input the script to picker.js

Start with these input tutorials and example projects on how input works with PlayCanvas:
https://developer.playcanvas.com/en/tutorials/?tags=input