[Solved] Error after make an add to the code

Hello i have made this add to my code

if (this.state==="sleep" && this.entity.script.Phealth.currentHealth<this.entity.script.Phealth.maxHealth) {
                this.actTime+=dt;
                if (this.acttime>1000) {
                    this.entity.script.Phealth.heal(1);
                    this.acttime=0;
                }
}

and now i have this error and can’t find it [playcanvas-stable.js:0]: Script error.
https://playcanvas.com/editor/scene/396696
to replicate the error just pick up the brown object close the player by clicking on it and click the icon that appear on the left side just upper the rosewind…after little time it got error

Hello, just found out that there is nothing wrong with code the problem is with animation when i click it on the editor (to make it play) in the lower left corner i have a red message script error…i will investigate that

Maybe it’s because it’s not an animation but a pose??(mixamo import in 3ds)

Are you talking about this script error?

If so, it’s most likely because ‘archer-sitted.json’ hasn’t been added to the player animation list

No no the problem is with the archer-sitted.json that give an error so that’s why i deleted it and make different tries but nothing works till now

Erm… I’m a bit confused. Do you still have a problem or have you fixed it?

I still have it…but is due to the animation…i will try again later when i get out of work

Ok tried it now before going home, i added a sleeping.json file and added it to the player model, if u click on the veeeeery small button to play the animation u see in the lower left corner script error in red…not tried in game yet but i guess it wont work

When you get errors like that, open the debugger in Chrome and enable ‘Pause on Exceptions’

This should stop the execution of the app where the exception took place:
Edit: Also tick 'Pause on caught exceptions (not shown in image)

Look at the data on the line of where it stopped to get clues. In this case, interpKey is undefined.

Going back up on the code to find where it gets assigned a value shows that it is looking for Bip01 L Finger01

However, if we look at the data of the player model, we see that the is no bone named that:

(To get this information I typed the following in the console):

var foo = pc.app.root.findByName('Player');
var bar = foo.findByName('Model');
var skin = bar.model.model.skinInstances;
for (var i = 0; i < skin[0].bones.length; ++i) {console.log(skin[0].bones[i].name);}

(Yes, you can type code in regards to the app and engine directly into the console. VERY useful for debugging at runtime :slight_smile: )

Admittedly, we could do some better error handling on missing bones than having an uncaught exception which I will put into a ticket.

In this case, I would check the original source model if this bone exists.

Yes the model don’t have fingers, however mixamo have put it in the animation…uhm…first time this happen…maybe i have screwed something…will look into that again…or will remove fingers manually.
Also seems that chorme tools are better than firefox ones…i should change lol
And thanx for the hints … will make a diary with that so i don’t forget :slight_smile:

The new debugger in Firefox isn’t quite a fully featured as the old one. I had to roll back to the old debugger to get some features like ‘watch expressions’ back: https://developer.mozilla.org/en-US/docs/Tools/Debugger

Will do that @steven thanks a lot…anyway solved the problem thanks to bvhhaker that allow me to remove unwanted nodes from animations so i was able to import it in 3ds and export the fbx that works. Thanks a lot for the support!!!