Hi guys!
I've found an interesting error, and I'm totally unable to solve it.
I've created a physics object in the editor with dynamic bodytype. If I do .applyImpulse() it works well.
If I clone the object in the code, and try .applyImpulse(), it doesn't work... Error message:
VM24315:1575 Uncaught TypeError: Cannot read property 'GetMass' of undefined
at PhysicsObject.applyImpulse (eval at afterLoading (wade.js:2941), <anonymous>:1575:14)
at eval (VM19044 app.js:11)
at wade.js:3079
The code:
App = function()
{
this.init = function()
{
wade.loadScene('scene1.wsc', true, function()
{
obj=wade.addSceneObject(wade.getSceneObject('SceneObject_0').clone(200,0));
obj.getBehavior('PhysicsObject').applyImpulse({x: -100, y: -100});
});
};
};
I can't figure it out, why it works with the original object, but doesn't with a cloned one. Do you have any ideas what I'm doing wrong?