How to find entity ID

I can’t find out how to get an entity ID and im trying to for a script

Hi @Nicholas_Taylor1,

PlayCanvas entities have a guid assigned internally, though that’s a private property and usually it shouldn’t be directly used.

If you know what you are doing, you can access it like this (unofficial API):

const id = this.entity._guid;

ok, where would I put this

What do you need the entity ID for?


What do you mean camera? Please try to be more descriptive to get more help.

sorry I’m trying to get the Id for a camera to move and rotate it in a script

If you know the camera name (e.g. name) you can get it like this in your script:

const cameraEntity ='Camera');

No need to use an ID.

oh ok thank you!

When I use it it says

Where are you using that? Share your code so we can help you.


oh wait never mind i deleted the script

im running into the same kinda problem. death.js,123914274