All videos · All how-to videos
How to react to Key Down and Key Up in R3
0:48 · 2026-10-29
In the R3 editor: add two Code components, set the first one's Event to Key Down and the second one's to Key Up, and give each one line: Space down makes the cube tall, Space up puts it back. Start Code, click the scene and hold Space. Hold it again and click outside the scene: the key still gets its Key Up. Narration: AI voice.
Chapters
Transcript
0:02 Open the menu, then Create, and add two Code components.
0:08 In the Inspector, open the first one, and set its Event to Key Down.
0:16 Press Edit Code. When Space goes down, make the cube tall.
0:21 Save, and close the editor.
0:24 Open the second one, and set it to Key Up.
0:28 In its code, put the cube back. Save, and close.
0:33 Start Code at the top, and click the scene.
0:36 Hold Space. Key Down. Let go. Key Up.
0:40 Hold it again, and click outside the scene. The key still gets its Key Up.