Make sprite disappear when not receiving input

jfenwick's icon

In the patch I've attached, a sprite is drawn on the screen.
When you're hold down the left mouse button, you're able to move the sprite with the mouse.
What I want to happen is for the sprite to disappear when you're not pressing the left mouse button.

Max Patch
Copy patch and select New From Clipboard in Max.

In the real patch I have a Kinect that is streaming in data.
When people are detected I want them drawn on a map.
When they're not being detected, I want their sprite to disappear.
I've also seen the situation where when someone walks off screen, their skeleton is still sending data, but it's just the same data over and over again.
I figure I want the opposite of change in that case, but the situation should be the same, I need a way to trigger the sprite getting hidden or moved off the screen.

movesprite.maxpat
Max Patch
jfenwick's icon

Eventually I just made it move off the screen ever 2 seconds with a metro. If it's still active the data coming from the sensor will immediately move it back, so it flickers, but this is good enough for what I'm doing.

Christopher Dobrian's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Use the 'enable' message to the 3D object.