Agent detect python
I'm trying to get my agent to detect whether there's a block infront of him.
Code:
I keep getting the error message "Error:AttributeError: 'Agent' object has no attribute 'detect'.
I can't find ANY info on how to do this ANYWHERE! Plz halp!
-
Hi Francesca Germer! Which Python are you using, MakeCode or Notebooks?
I had the same error in MakeCode, so I restarted with the same exact code that time, it worked.
If you are coding Python in Notebooks, the commands and syntax are a little different. Hope this helps!
0 -
hmmm ok. I'm using notebooks. Is there a way to use inspect to detect just whether there's a block there or not? Not a specific block type, I just want to know if there's something there.
0 -
I believe that agent.detect("down") returns a true/false value for whether a block is present. =]
0
Please sign in to leave a comment.
Comments
3 comments