Previous Thread  Next Thread

chat icon How do I get all ADDED obj names?

Jedijds

Posted: Thu Oct 11, 2012 6:01 pm
Joined: 30 Jan 2012
Posts: 115
Cant figure out how objects from add object actuators are named.
Say I want to draw a line from one cube to all the other cubes that are added to the game scene from an object actuator. I set up a scrip on the cube I want all the lines to be drawn to.

cube1=bge.logic.getCurrentScene().objects['cue']
cube=bge.logic.getCurrentScene().objects['Cube']
render.drawLine(cube1.worldPosition, cube.worldPosition, [1,0,0])

‘cue’ is the name of the cube added to the first layer from the second layer through an add object actuator. (‘always’-‘and’-‘edit object’ in logic bricks)
‘Cube’ is the static cube I want the all the ‘cue’ cubes lines to be drawn to.

Problem: only the first cube that pops in to the scene gets a line. Why is this? How could I get all the cubes to have a line? (Do the added cubes have a different name?)
_________________
۞◄█°‖‖‖‖‖█ʭʭ╬(░▒▓▓▒▒▒▒▒▒▒▒▒)
Reply with quote


 
Jump to:  
Powered by phpBB © 2001, 2005 phpBB Group