@property({kind : SpriteComponent})
public airplane : SpriteComponent|null = null;
personal rating = 0;
replace(deltaTime: quantity) {
let lblScore = this.node.getComponent(Label);
**if(this.airplane.place.x > 113 && this.airplane.place.x < 130)**
{
this.rating += 1;
lblScore.string = "Rating : " + this.rating;
}
}
}
Within the above code when ‘airplane’ spritecomponent reaches sure place i need to replace the rating worth. however “this.airplane.place.x” doesn’t appear to work!!
what’s the motive ? how do i get its place?
Thanks for answering, however when i console “airplane.node.place.x” giving the preliminary place of airplane part although the airplane is constantly transferring.