So…could anyone tell me how could i use variables of one controller in another controller
if i have two objects,one has a variable speed
now, if i wanted to use the same varialbe speed in another objects controller, what would i have to type in the script.
You can use:
own2 = GameLogic.getCurrentScene().getObjectList()["OBName"]
#Replace Name in "OBName" with the name of the object to which the
#the variable in question was originally assigned
#Then just call it as you would usually with own2
Or connect the python controller to one of the actuators of the object holding the variable and do:
own2 = cont.getActuator("actuatorname").getOwner()
Or you can use a global variable that can be accessed from anywhere “GameLogic.myvariable” I think.
i also have a problem parenting a camera.
when i parented a camera to one object, it worked,but when i parented it to another one, it didnt work.it was parented, but the object that it was parented to, wasnt visible.
Be more specific, or post the .blend.