How to create this script? Collect coins

I want to make a 3D game of collecting coins and have the score appear at the top in text.

Is it the same in 2D and 3D?

Or does the code for that change?

Please help!

Hi @BeHappy,

Scripts in PlayCanvas can control the behavior of any entity, both entities that reference models (3D) and elements/sprites (2D).

For collecting coins a good place is the triggers tutorial, that’s useful for collectables in games:

https://developer.playcanvas.com/en/tutorials/collision-and-triggers/