AttributeError排查:Player类无x属性的AI追逐代码报错
问题:AttributeError: type object 'Player' has no attribute 'x'
我正在编写AI行为代码,逻辑为AI在玩家附近区域被动移动,距离足够近时开始搜索玩家,距离更近时转为主动追逐玩家(目前玩家暂无法移动)。
报错信息
AttributeError: type object 'Player' has no attribute 'x'
已做排查
- 检查过Player类初始化方法中变量的命名拼写,确认变量存在,但问题仍未解决。
内容的提问来源于stack exchange,提问作者Comm_GT
相关产品推荐
相关产品推荐

