[SOLVED] Why do I see repetitive items in here?

I need to access a component to make some game logic. When i opened my game on F12 and printed the entity i need to change i’ve found two instances of the same component…are they the same or is better to access it by a different way because of its read only return functions?

I am looking for best practices here related to access and call functions from components and scripts :slight_smile:

Hi @MuriloCamargo,

Yes, it’s the same component instance in both cases!

The proposed way of accessing components is using the component type name directly on the entity:

this.entity.camera;
2 Likes