0
$\begingroup$

I am trying to make a target disappear one second after hitting enter. However, I am running into a major problem. The delay sensor starts counting down as soon as the game starts and I need it to count down after I press enter. I've been all over the internet and I've found no solution to this seemingly novice problem. Attached is what I see in blender.

Thank you!

  • John

The blender logic data

$\endgroup$
1
$\begingroup$

Delay is like a timed trigger. Think of it as an Always sensor, with a delay in frames. The Delay and Duration Settings, are like the ping-pong counts. Ping -> true for sixty frames, pong false for 60 frames.

If Duration is set to 0, then it's just Ping, Ping, Ping every 60 frames, from the moment you hit Go!

Probably the easiest way to deal with this, without getting into Python, is to use the Logic States.

In your first state, set up your sensor for keyboard, and use 'State Actuator' to set game to second state.

Logic state 1

In your second state use the Delay Sensor. The Delay won't start running until we enter the new state. So, you will have 60 frames from that point before the object disappears.

enter image description here

Things that you want to pay attention to:

  1. Controllers link directly to states. So, make sure you have the correct State selected before adding your Controller.
  2. Make sure that you Keyboard Sensor is in the 'Inital' State. Otherwise it won't get triggered.
  3. It is possible to have Sensors and Actuators linked to multiple States. This way you don't have to rebuild your logic for each State.

hope this helps.

$\endgroup$
  • $\begingroup$ Wow, I wasn't expecting such a thorough answer! Thank you, and now time to read it... $\endgroup$ – John Miller Jan 27 '16 at 0:00
  • $\begingroup$ It works. I can't believe it's so simple. Thank you (: $\endgroup$ – John Miller Jan 27 '16 at 0:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.