Bind TapEvent to a specific input

audun Posts: 302 🔥🔥🔥

I'm trying to modify a script that is currently attached to my Orthographic camera.

The script runs whenever a tap is registered on the screen, but I want to modify it so that it only runs when someone taps one of the image inputs (muted or playing).

Here's the current script:

//@input Component.AudioComponent audio
//@input Component.Image muted
//@input Component.Image playing

var isPlaying = true;

script.muted.enabled = false;

function onToggle() {
     print("paused: " +
    isPlaying = !isPlaying;
    if (isPlaying) {
         print("playinhg" + isPlaying)
        script.playing.enabled = true;
        script.muted.enabled = false;
    } else {
        script.playing.enabled = false;
        script.muted.enabled = true;


How can I do this?


Best Answer

  • audun
    audun Posts: 302 🔥🔥🔥
    #2 Answer ✓

    Solved it by adding an Interaction component to the Orthographic camera :smiley: