当前位置:网站首页>Cocos creator collision and collision callback do not take effect

Cocos creator collision and collision callback do not take effect

2022-07-07 15:39:00 Vegetable chicken on the road

1、 Collision does not take effect
Remember that , When using physics , Be sure to turn on physics first :
cc.director.getPhysicsManager().enabled = true;
Only in onLoad() in Turn on It works , stay onEnable() perhaps start() All invalid
2. Collision callback does not take effect
If you want to execute the collision callback function in the official document , Two things to note
(1) Check the following options for rigid bodies , Rigid bodies that collide, whether dynamic or static , Both need to be checked
 Insert picture description here
(2) Start collision callback
cc.director.getCollisionManager().enabled = true;

原网站

版权声明
本文为[Vegetable chicken on the road]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130612339379.html