I’m using an actuator to add objects. Each object has the property “health”. I have a ray sensor set to look for said property, and a python script to find the hit target within getObjectList(), and decrease the property health. My problem is it’s decreasing the wrong objects “health” (it’s doing it in spawn order instead). This problem was mentioned in the 2.35a bug fix list;
setObject take KX_GameObject & not string. When applying a target object for an actuator via python this must now be a pointer to the object (such as those returned by GameLogic.getCurrentController().getOwner() or GameLogic.getCurrentScene().getObjectList()) not the name of the target object as a string. An example of where this was a problem is that Objects added to the scene via an AddObject actuator are not assigned a unique name.
- I don’t fully understand the solution. Any help would be appreciated.