Hi, i want to move an object in a walkthorough, the user moves the camera with the keyboard and when he clicks an object he “catches” it and the object moves parented with the camera, i used an Empty to do this.
It works but I can’t leave the object where I want, I need to leave the object with a click so I have to sensors:
a Left Click sensor = senso
a Mouse Over sensor =senso1
2 properties: moved and click, to set that the user clicked the object and moved it
linked to this script:
from Rasterizer import showMouse
cont = GameLogic.getCurrentController()
own = cont.getOwner()
scene = GameLogic.getCurrentScene()
senso = cont.getSensor(“senso”)
senso1 = cont.getSensor(“senso1”)
if senso.isPositive() and senso1.isPositive():
own.click = 1
object = scene.getObjectList()
for o in object:
if (o.Name == “OBEmpty”) and (own.click==1)
pos = o.getPosition()
own.moved = 1
if (own.moved ==1):
if (senso.isPositive()) and (senso1.isPostive()):
own.setPosition([1.0, 2.0, 3.0])
When I debug it i see that it never leaves the object in position (1,2,3) because senso.isPositive() never gets the value = 1 it’s always 0, no matter how many times i click the object, instead senso1 does get the 1 value.
and how could i make it work??