I added an overlay scene, there is a object has animation keyframes.
There are some objects with different property in current scene,
I want to mouse click one of objects in current scene,
the object in overlay scene will play animation with specify property/keyframes.
I tryed direct action, but it not work.
I try send message from current scene to overlay scene,
but I don’t know how to receive the property from message.
I’m new, Can I do that only use logic not python script?
Hi YQ-YSY,
my_object[‘variable_name’] refenences a specific property of the corresponding object.
In order to make the scrip work, you need to insert the exact names of the properties (regard upper- or lowercase letters).
The line
message=cont.sensors['message']
tries to reference a sensor called “message” but yours is called “Message”.
The line
own['property']=message.bodies[0]
tries to reference a property on the sphere called “property” but yours is called “prop”.
Thank you Wendigo & MrPutuLips. Finally I solved BluePrintRandom’s script.
I correct the name of of the properties “messages” and “property”,
but then I received the message is “-1” , not the right value,
I search google found this arcticle, solved this problem: http://blenderartists.org/forum/archive/index.php/t-243697.html
In BluePrintRandom’s script, just add int() in front of message.bodies[0] is OK.
import bge
cont = bge.logic.getCurrentController()
own=cont.owner
message=cont.sensors['message']
if message.positive:
own['property']=int(message.bodies[0])