Attributes problem

I added attributes in my script.
Clicked Parse, and drag n drop Entity to the field .

But i can’t access to attributes with the script, i even copied code from PlayCanvas Manual

Here is my code , i am just trying to turn off the object
In manual it says this.name , but that is not working as well


You just need to do:

var ChipPlacement = pc.createScript('chipPlacement');

ChipPlacement.attributes.add('target', { type: 'entity' });

ChipPlacement.prototype.initialize = function () {
    if (this.target) {
        console.log(this.target.name);
    }
};