Is it possible to block unity's input?

Hello,

I have a custom Android plugin to play video over unity. It’s all working great.

However, I need to block unity’s input because there’s a scene running behind the video.

I’ve tried overriding the onTouchEvent on my Activity to no avail.

My Activity is extending UnityPlayerActivity

@Override
public boolean onTouchEvent(MotionEvent event) {
    // return true should consume event
    return true;
}

Also, I tried adding a custom view on up of my video player with fill_parent and used onTouchEvent.

Unity is always getting inputs. Is this possible?

Thanks,

Hugo

EDIT #1 : I’ve tried setting onTouchListeners everywhere and it’s still not working. I’m not able to stop the propagation.

unityPlayer is found searching for if (view instanceof UnityPlayer)

           unityPlayer.setOnTouchListener(new OnTouchListener() {

                @Override
                public boolean onTouch(View v, MotionEvent event) {
                    // return true should consume the event...
                    return true;
                }
            });

Just don’t check for input then.
I’m usualy doing it like this in all my controller scripts (C#) :

using UnityEngine;
using System.Collections;

class myclass
{
    // This is what controlls if the player will be able to move
    boolean isControllable = false;
    
    void Update()
    {
        if(isControllable)
        {
            // This will be ran if the player IS able to move
        }
        else
        {
            // This will be ran if the player IS NOT able to move
        }
    }
}

By setting “isControllable” to false at the beginning of movie, the player won’t move during the movie!
Just set it to true again when the movie is finished, and the player will be able to move again!

/TheDDestroyer12

EDIT: I think I missunderstood you, but I think this will work anyway. You just have to put it in your controller script in the unity project, and change the “isControllable” variable from the android plugin (don’t know if that’s possible, but I think so).

Good luck!