Guys Thank you very much for all help here, amazing people everyone!
I having a simple problem, I trying understand how is the correct way to manage the variables inside “properties” I have something like:
properties: {
lblStatus : cc.Label,
// PotionA : cc.Node,
PotionA : cc.Node ,
},
I tried this too :
properties: {
lblStatus : cc.Label,
// PotionA : cc.Node,
PotionA :
{
default: null, type: cc.Node
},
},
When I call this.PotionA in the static start function , everything works fine with:
start () {
this.PotionA.on("touchmove" , this._Test , this.PotionA);
},
but when I call the object in the my custom callback :
_Test : function(events)
{
cc.log('working');
let delta = events.touch.getDelta();
this.PotionA.y += delta.y;
this.PotionA.x += delta.x;
},
Its calling the callback, is printing “working” but got this error "typeError: undefined is not an object (evaluating ‘this.PotionA.x’). "
how I fix this and move the x and y of the node, the variables are linked in cocos creator interface.