Monday, May 30, 2022
HomeGame DevelopmentDid not get the default worth of velocity at school "newclass" -...

Did not get the default worth of velocity at school “newclass” – Code IDE


i used to be following a tutorial i observe it like a ebook and that i bought an error which i do not know what may have trigger it
it says:
Did not get default worth of “velocity” at school “NewClass”. If utilizing TypeScript, you additionally have to go within the “default” attribute required by the “property” decorator.

the code i used:

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Element {

@property
velocity: quantity = 10 ;

     onLoad () {

     }

    begin () {

    }

     replace (dt) {
         this.node.setPosition(this.node.place.x+this.velocity*dt,this.node.place.y);
        if(this.node.place.x>this.node.dad or mum.width)
        {
            this.node.setPosition(0,this.node.place.y);
        }


         
     }
}

not solely that however i’m additionally unable to set the worth in cocos creator because it ought to
it ought to seem a field the place i set the worth for every particular person zombies however the field will not be even there.

please clarify me why i bought this error, what may have induced it and learn how to repair it.
Thanks!!


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments