Howdy.
So I’m making a game. In it there is an enemy which automatically faces the player when he/she comes within a certain distance. It also moves forward (towards the player) if it can establish a ray to the player within that same distance.
I also set up bricks to use a property “shoot” that starts at 100 and has an always sensor decrementing it by 1 - so I guess you might say “shoot” goes down by one with each passing unit of game time. I also set it to force an empty attached to the enemy to create a bullet when it reaches 0, as well as to reset the “shoot” property to 100 again to start the count over. The effect is that the enemy shoots once every couple seconds.
Now, if I attach ONLY the “shoot = 0” sensor to the “and” controller that tells the empty to create a bullet, it does what I just said - however it will shoot continuously regardless of whether the player is nearby. This is a problem because once I get 4 or 5 enemies in the level they’re all creating bullets simultaneously and needlessly causing things to chug. So I connected he ray sensor to the same AND controller - and nothing happens.
So I know that each of these sensors works individually. The ray sensor works because the enemy moves towards the player when it establishes the ray - I also know this isn’t just the near sensor I used to make it face the player, because I can get close to the enemy but from behind a translucent surface and the enemy will face the player but not move towards him/her. Like I said, I know the bullet property sensor works as well because it causes the enemy to shoot provided it is the only thing hooked up to the AND sensor.
So why is it that two sensors that each works on its own will cease to work through an and sensor? I had managed to get this setup to work fine in an earlier incarnation but blender crashed and I had to load an earlier version and do it over again - and it no longer worked. By the way, I set the ray sensor to TRUE level triggering - this did not help.
as a side note, it seems like this kind of stuff “just happens” in blender now and then. Something that clearly should work suddenly won’t, and you have to go back and load an earlier version of the .blend file, or simply accept the fact that blender won’t let you do something in the particular version of the particular .blend file you’re working on for no particular reason. Is it just me or have other people noticed this?