title: How do I make an Object active on key down?
body: <p>I'm using Unity's new input system and I'm trying to set up an input that places a shield in front of you as long as you hold the key down.
  At the moment I can make the shield appear in the world but it's fixed in the world and locked to one direction.</p>
  <p><a href="https://i.stack.imgur.com/M8sm2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M8sm2.jpg" alt="Like so" /></a></p>
  <p>Right now this is the code.</p>
  <pre><code>private void ShieldUp() {
      GameObject shield = GameObject.Instantiate(shieldPrefab, playerFront.position, Quaternion.identity, bulletParent);
  }
  </code></pre>
  <p>I created a prefab for the &quot;shield&quot;, playerFront being the location where I want it spawn. I think all I've done is make it so every time I hit the shield key it just makes a prefab.</p>
  <p>But, like stated before, I want it to only appear while the key is held and deleted when the key is released.
  I'd also want it to face the same direction as the character, but one step at a time.</p>