Hello,
I’m using cocos creator v1.6 to make a game for website and native.
I want to instantiate nodes at the top of the Canvas and make them fall with gravity, and, when they collide with a node at the bottom of the Canvas (let’s call it baseNode), create a distance joint component in the falling node and set the connectedBody property as the rigidbody of the baseNode.
I was succesfull on that task, I inspected element and the property connectedBody was actually the baseNode rigidbody but nothing happened in the game, the falling node is moving like it doesn’t have any Distance Joint atached.
Thank you! It worked perfectly
I was seting it’s properties directly, like: this.node.addComponent(cc.DistanceJoint) and then this.node.getComponent(cc.DistanceJoint).connectedBody = other.node. I don’t know why it doesn’t work this way, but putting the addComponent inside a let works fine.