- I have an object colliding, and on collision, prints the objects name. Why does it always trigger, giving me NoneType errors?
- I have an object colliding, and on collision, needs to set location. I thought it would just be Object.Location = 0, 0, 0 or Object.Location = Spawn.Location. I have tried this with Location(), Loc, and Loc() too. None work (PS, the object is gotten with col.getHitObject(), where col is the colision sensor)
- How can I go about import the modules to allow the except statement (is it a statement?) in Blender Game Engine?
- I’m going to guess you aren’t filtering the pulses. The sensors fire off a negative and a positive pulse. If every other time gives you that error then do something like the following:
cont = GameLogic.getCurrentController() col = cont.getSensor("col") if col.isPositive(): ob = col.getHitObject() print ob.name
You don’t need to import anything. Just use it:
try: stuff except: print "Oops"
object.position = [0,0,0]
moguri. i love you.
so that’s what true and false triggering are for? true only sends out positives, false negatives? Or if I select False Level Triggering, that filters OUT negative pulses? cause I’ve always wanted to know Also, i forgot the ‘try’. oops
Bluesocarrot: that’s weird i have know idea what i was doing, but for some reason, i was being stupid. i got it thanks
not sure what it can be used for but use this for a python index…