activating and deactivating gameObject on keypress?

bit of a noob when it comes to scripting with c# but want to know if there is an easy way to instantiate an object on getkey down. So a shield and then when I let go of shift the object will be disappear and to be able to repeat this step

There’s a big difference between instantiating and enabling/disabling a Game Object.

In your case, GameObject.SetActive() is the method you want to use.

First, you declare a GameObject field:

public GameObject shieldObject;

And then, on a function that ocurrs every frame (i.e. the Update () method):

if (Input.GetKeyDown(KeyCode.LeftShift))

else if (Input.GetKeyUp(KeyCode.LeftShift))

This will enable the shield object whenever the player starts pressing shift, and disable it when the user stops holding it.

You could also do the same thing with Object.Instantiate(), but it would require some more unnecessary work.