Added Objects: Name?

When you add the same object during game runtime, the is the same for all those objects.

Then when you call myobject = scene.objects[] only the first instance of the object will be called

Is there a way to call a different instance of the object?

I have only managed to do so with a ray from another object on the object i want and used myobject = ray.hitObject

edit: or is there a way to change the name of an object before adding it?

scene.addObject return a game object, you can save it in a property and use it later intead of using scene.objects, you can use it also to change its name.

myObj = scene.addObject("myObjName") #Add the object and store it temporally. = "Something" #Make what you want with the added object
owner["someVariable"] = myObj #You can access to the object later using this property, you can also store it in the first line

aah ok thank you! ill definetly use this in my game :smiley: