I have added an overlay scene, for a HUD, to my game using logic bricks and the space bar key to activate the scene. How do I use the same key to turn off the overlay scene and use it as a toggle for on and off?
set the spacebar to toggle a property true/false. - you need to enable tap (2.49)
I guess you can make it smaller using expression and the NOR controller
It also works with inv states
Attachments
Thank you for the quick reply.
no problem
If you have the time, would you post and example using expression and the NOR controller. Thank you.
I’ll look into it, and i’ll go with STATES until then! ( but if you decide to use the property method, don;t forget to enable TAP for key sensor)
Thanks for taking the time. I am new to using Blender and the game engine and still feeling my way around. Could you recommend any tutorials or examples on using states.
http://lostinspacesite.googlepages.com/states.html here, but you should use google next time
also, take a look at this, this is a crazy way to do it but it works, i’ve tested it
you have
sensor - and cont - property(prop, value- prop * (-1)
prop = 1 and- add overlay scene
nor - remove overlay scene
Attachments
You can also toggle booleans by setting their value as !propertyname
I have looked at that tutorial and understand how it works using collision. Do I just use booleans to change states using a single key? That is why I asked if there were any other tutorials or examples available. The examples you provided have helped quite a bit, Thank you.
Do I just use booleans to change states using a single key?
yes lol just give it a try