NOTE
To test the **Send My custom Event** node and the **On my CustomEvent** node both the following steps must be completed:
- Create a simple custom event node.
- Create the event sender node
### Adding a GameObject to send the event on key up
To add a GameObject to send the event on key up:
1. In the Hierarchy window, create a new empty **GameObject** and name it EventSender.
2. Add a ScriptMachine component.
3. Add a new script graph in the Script Machine component.
4. Open the graph.
5. Right-click on the graph background to open the fuzzy finder.
6. In the fuzzy finder, search for “On Keyboard Input”.
7. Right-click on the graph background to open the fuzzy finder.
8. In the fuzzy finder, search for “Send My custom Event”..
9. Connect both nodes.
Example: to connect to a keyboard input...
![](images/vs-custom-event-send-my-custom-event-node-keyboard.png)
### Adding a GameObject to receive the event and execute code
To add a GameObject to receive the Event and execute code:
1. In the Hierarchy window, create a new empty **GameObject** and name it EventReceiver.
2. Add a ScriptMachine component.
3. Add a new script graph in the Script Machine component.
4. Open the graph.
5. Right-click on the graph background to open the fuzzy finder.
6. In the fuzzy finder, search for “On my Custom Event”.
7. Right-click on the graph background to open the fuzzy finder.
8. In the fuzzy finder, search for “Debug Log”.
9. Connect both nodes.
Example: to receive the event and write the Event Value to the console...
![](images/vs-custom-event-on-my-custom-event-debug-log.png)
Once these steps are complete do the following:
1. Test the setup.Press the play button to start the game.
2. Press and release the Spacebar.
3. In the Unity console, you should see a message confirming your actions.
##