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 Answer 1

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$
2
  • $\begingroup$ Wow, I wasn't expecting such a thorough answer! Thank you, and now time to read it... $\endgroup$ Jan 27, 2016 at 0:00
  • $\begingroup$ It works. I can't believe it's so simple. Thank you (: $\endgroup$ Jan 27, 2016 at 0:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .