[SOLVED] cc.director.getCollisionManager is not a function?

Hello,

I am new to this i am trying to enable the physics… on Cocos Creator version is 3.1.2
But getting error…

Any help will be appreciated! :pray:

https://docs.cocos.com/creator/3.1/manual/en/physics-2d/physics-2d-system.html


You can refer to this.

you must import director

@Koei Thanks for reply


I tried this I guess it should draw border surrounding the true sign… But there is no border
Please Correct me if i am wrong…

@perfecto Thanks for reply
I tried using director in import but it still giving me same error…

This needs to switch the 2d physics engine to builtin, the camera visibility needs to be checked DEFAULT.


2 Likes

@Koei Thank a lot you saved my life :grinning:

I referred this for collision detection with another object.
https://docs.cocos.com/creator/3.1/manual/en/physics-2d/physics-2d-contact-callback.html

I added another sprite with different group name to test out collision and it worked…

Thank you very much! :pray: