if o_Player > x {
char = 1
}
if o_Player < x {
char = 0
}I assume o_Player is the name of the player object resource? This code tries to compare that object resource name to the enemy's x coordinate, which doesn't make sense! Game Maker does internally give each resource a number, so as far as it is concerned it is acceptable to compare that to a numerical x coordinate and that is why you don't get an error - but I imagine you actually intended to compare the enemy's x coordinate to that of the player.You could use o_Player.x to refer to the player's x coordinate, but only as long as you only ever use one single instance of the player object. If you do sometimes use more than one for any reason you'll need to use the instance ID of the specific player instance whose x coordinate you need to refer to.
Hope that helps.
Richard



Find content
Male


