I need to make a dynamic circle collider component for a node.
the prefab i am adding the collider to does not have one already set in cocos creator.
i have tried this…
var Collider = new(cc.Collider.Circle);
Collider.Radius = bombRadius;
this.node.addComponent(Collider);
I get this error;
Error 3809, please go to https://github.com/cocos-creator/engine/blob/master/EngineErrorMap.md#3809 to see details.
error 3809
addComponent: The component to add must be a constructor
I thought the better way would be to set a circle collider for the prefab in the cocos creator UI and then just update it through the script on initialization of the prefab however i can’t find the setCircleColliderRadius() function.
Does any one know how i can achieve either of these methods? hopefully both