So for my game I need a button on my UI to allow selection for my character to go to an object. I am using different states to do this. So I will have a state that allows you to click on the character and the button pops up (which is also across scenes in an overlay scene, which works just fine). I am using properties to switch states on my character. I have done this successfully before with a similar code on other objects. However the problem is that I am trying to do this to an object on a hidden layer. When I run the code, no errors pop up on the console, yet nothing happens either. It is apparent that the property hasn’t been altered at all. If someone could help that would be great. Thanks.
import bge SMouseOver = "sMouseOver1" SMouseLeft = "sMouseLeft1" def characterResource(cont): #check for sensors sMouseOver = cont.sensors[SMouseOver] if not sMouseOver.positive: return sMouseLeft = cont.sensors[SMouseLeft] if not sMouseLeft.positive: return #set object to change property of : .objectInactive added to this version of the code obj = bge.logic.getSceneList().objectsInactive['worker.b.dynamics'] obj['UI'] = 1
I will try to upload the file later but I have been receiving errors. Thanks in advance for any help