[SOLVED] A function is not called

Why this line

app.root.findByName("Player").script.player.fishing();

Don’t launch the function inside player.js? Thanks.
https://playcanvas.com/editor/scene/396696
https://playcanvas.com/editor/code/352037/Action.js
https://playcanvas.com/editor/code/352037/player.js

Does it give you any errors? Also, have you tried putting a console.log() directly before the fishing() call to see if your code even makes it there?

It just says that fishing is not a function…and i don’t get why

Er… You have player.fishing defined twice. L67 and L1411

        this.Mearth=1;
        this.hunting=3;
        this.huntingAdv=0;
        this.fishing=0;
        this.fishingAdv=0;
        this.blades=0;
        this.bladesAdv=0;
        fishing: function () {
                this.state="fishing";
                this.model.animation.play("sit.json", this.blendTime);
                this.model.animation.speed =0.2;
                this.model.animation.loop = true;
                this.entity.findByName('Fishing rod').enabled=true;
            app.root.findByName('Root').script.Output.drawProgress(this.actTime);
        },

:sweat_smile: ooops missed that…too many variables…thanks a lot @yaustar