这个错误发生在游戏中的守卫随机转身时。除了这个情况之外,我不知道这个错误的原因。所讨论的错误是:

###################################################################################### ERROR 在步骤事件0的动作1中,对象OPlayer:尝试设置实例ID100018(OGuard)与无效的边界top639.000000bottom657.000000left-nan(ind)right-nan(ind)的对象索引7(OGuard)于gml_Object_OPlayer_Step_0(第20行)- 如果place_empty(x+xspeed,y-3,OFloor){ ############################################################################################ gml_Object_OPlayer_Step_0(第20行)所引用的代码只是水平碰撞代码,似乎与守卫无关: if place_empty(x+xspeed,y-3,OFloor){ x+=xspeed; }else if place_meeting(x+xinput3,y-3,OFloor){ if place_meeting(x,y-3,OFloor){ x+=xinput; sprite_index = SAssassainSpecial; } yspeed = 0; image_index = 0 if keyboard_check_pressed(vk_space){ yspeed = -5; sprite_index = SAssassain; xspeed = image_xscale-3; } } 守卫的步骤代码是: if round(x/3)3 != round(steps/3)3{ x+=(-x+steps)/abs(-x+steps); image_xscale = (-x+steps)/abs(-x+steps); image_speed = 1 alarm_set(0,60); }else{ image_speed = 0; image_index = 0; } if gunOut{ steps =lastseenX; } 守卫的视觉步骤事件是(‘父变量引用守卫的ID): x = parent.x; y = parent.y; image_blend = c_white; image_xscale = parent.image_xscale; if place_meeting(x,y,OPlayer){ sprite_index = SBullet; dir=point_direction(x,y,OPlayer.x,OPlayer.y); while (place_empty(x,y,ODoor) && place_empty(x,y,OPlayer)){ x+=sin((dir+90)(pi/180)); y+=cos((dir+90)(pi/180)); } if place_meeting(x,y,OPlayer){ image_blend = c_red; parent.gunOut = 1; parent.lastseenX = OPlayer.x; } sprite_index = SVision; } image_index = parent.gunOut; x = parent.x; y = parent.y; 我查阅了这个错误,但每个实例的原因都不同。我希望这个错误不再发生(此外,这是为了节目,所以希望能快速解决这个问题)。