[SOLVED] Cannot read properties of undefined (reading 'clone')

Need help :frowning: I am trying to clone a platform but it says that my properties are undefined. I already checked if I accidentally missed putting it on my entity but it’s there, what should I do?

Hello @Kaycee_Garcia and welcome,

Can you share a link to your project so we can take a look? Or at least the part of the code responsible for the error.

https://playcanvas.com/editor/scene/1391720

Here, thank you so much for helping me @Leonidas , I need this game for my finals requirement in school :frowning:
The error is on GameManager.js, Line 29

When you’re declaring the attribute, the world Obstacles is written with capital O (line 4).

GameManager.attributes.add('Obstacles',{type:'entity'});

But when you’re cloning the attribute, obstacles’ is written using lower case o (line 29)

 const initialDrQuackQuackObstacles=this.obstacles.clone();

I changed it, but it still says “Cannot read properties of null (reading ‘clone’)” :’(

Oh it worked after I refreshed my scene!!! Thank you so much @Leonidas I owe you a lot!

1 Like