This platform script has a error that does not exist.See if my blend works for you.
import bge
def main():
cont = bge.logic.getCurrentController()
own = cont.owner
forward = cont.sensors["forwards"]
clockwise = cont.actuators["clockwise"]
counterclockwise = cont.actuators["counterclockwise"]
collision = cont.sensors["collision"]
setParent = cont.actuators["setParent"]
removeParent = cont.actuators["removeParent"]
if collision.positive and not forward.positive and not clockwise.positive and not counterclockwise.positive:
target = collision.hitobject
setParent.object = target
cont.active(setParent)
else:
cont.active(removeParent)
main()
Here is the error I get in the console.
Python script error - object 'Cube.017', controller 'Python':
Traceback (most recent call last):
File "slide prevention moving platforrm", line 23, in <module>
File "slide prevention moving platforrm", line 10, in main
KeyError: 'requested item "clockwise" does not exist'