pass prop from one object to other

hy all,

is there a way to pass a prop from one object to the other?

THX in advance for your help

You could use global variables (by attaching your property to the GameLogic module). ie:

–To set variable on 1 object

import GameLogic
cont = GameLogic.getCurrentController()
myObject = cont.getOwner()
GameLogic.myProperty = myObject.aProperty

–To Read the variable on a different object

import GameLogic
cont = GameLogic.getCurrentController()
myObject = cont.getOwner()
myObject.myProperty = GameLogic.myProperty

hope that helps, there’s probably a better way to do it using message actuators, but this is a simple way around it.

The copy mode of the property actuator is designed for that. You’ll find a description in this reference:
Reference

This only works with objects in the same scene. The method MeiaLua used will work between scenes.

THX a lot - works fine