TypeError: Cannot read property 'load' of undefined at cc.resources

1.5k views Asked by At

When I try to use cc.resources.load(arg1, arg2), I get this error:

Uncaught (in promise) TypeError: Cannot read property 'load' of undefined

As far as I know, it is a built-in Cocos Creator class and the documentation itself says to use it. When I try to call cc.log(cc.resources), it shows undefined in the console. A folder called "resources" exists in my project and it's not empty.

1

There are 1 answers

0
Daniel On BEST ANSWER

cc.resources isn't available in Cocos Creator 2.3.3, only 2.4.

The solution is to use the function cc.loader.loadRes.