[SOLVED]Troubles converting from legacy scripts

Hello, i’m converting my huge amount of code, now i have this error
Chrome


but the variable is set in the initialize function var targName="";
why do i get that error?

Hi @ayrin, that’s way too little information to help you out.

In the blind, if you are setting this variable in your initialize method and accessing it in other script methods, you should set it like this:

this.targName = 'something';

And use it accordingly in your code, e.g.:

this.entity.name = this.targName;
1 Like

@Leonidas that’s true, i used var targName but i could use this.targName how silly of me thanks

1 Like