Where is the unindentation error?How do i find it everytime?Here is the blend.
import bge
cont = bge.logic.getCurrentController()
obj = cont.owner
sens = cont.sensors["Lisa"]
actuator = cont.actuators["Bob"]
if sens.positive:
cont.activate('Bob')
else:
cont.deactivate('Bob')
main()
Attachments
python b.blend (414 KB)
at line 10, the else must be at the same indentation as the if it belongs to
Thank you.Do You know a lot about coding in blender game engine?
Cotaks
(- Click for (UP)Bge resources)
4
here is an example of how it works:
# example tree
if ........: #1
if........: #2
if........:#3
else.....: #3
else .....: #2
else .......: #1
#or u can do:
if........:#1
else.....: #1
if........:#2
else.....: #2
has not much to do with blender specifically, its just how python works. any beginner python tutorial can help you with that