this.hitTest not a function


#1

when I used my program, I am trying to do a very simple platformer the hitTest isn’t working and just says this.hitTest isn’t a program.
Platformer1-Feb22-2019-8.05AM.wick (2.8 KB)


#2

okay, apparently it works if you change “this” to the name of the object so :
it would look like
if player.hitTest(Ground) {
///do something here
}


#3

Wow, so that’s it, I encounter this problem, I thought is my problem, and I just changing to use the location
if ((this.x > 32.9-50 && this.x < 32.9+50) && (this.y > -158.47-50 && this.y < -158.47+50) ){
earth.gotoAndStop(270)
}