i am programming on a small fun mini- game where u have to catch bananas with your telescope arm
i tried to wirte a script, where an object moves, while you are pushing the space button
and of course---- i failed:
it actually doesn`t do anything
here is it:
import GameLogic
scene = GameLogic.getCurrentScene()
cont = GameLogic.getCurrentController()
Hand = scene.getObjectList()[“OBHand”]
move_H = cont.getActuator(“move”)
Hand_start_pos = (-4.123,-2.67,0)
Arm = scene.getObjectList()[“OBArm”]
Hand_Position = Hand.getPosition()
Arm_Position = Arm.getPosition() #Get Position
Leer = cont.getSensor(“Leer”)
if (Leer == True):
move_H.setLinearVelocity(10,0,0,True)
Arm.setPosition(Hand_position-Hand_start_Position) #Arm.setScale