Video () on ()
video (motion v) on (sprite v)
Category Video Sensing
Type Reporter
Introduced in 2.0

The Video () on () block is a Video Sensing block and a Reporter block. It gets values of the video, either motion (on a scale of 1 to 100) or direction (which way the detected motion is going, measured on the same plane as sprite direction), on either the stage, or the current sprite. If there is no video, the block will return -1.

It calculates the values based on "optical flow".

Prior to Scratch 3.0, this block was labeled as a Sensing block.

Example Uses

  • Moving a sprite by moving
  move (video (motion v) on (this sprite v)) steps
  point in direction (video (direction v) on (this sprite v))
  • Popping balloons
if <(video (motion v) on (this sprite v)) > [30]> then
  play sound (pop v)
  • Sensing lots of action, by also using loudness
when gf clicked
 if < <(video (motion v) on (Stage v)) > [30]> and <not <(loudness) > [30]>> > then
  say [Turn up the volume!]
 if < <not <(video (motion v) on (Stage v)) > [30]>> and <(loudness) > [30]> > then
  say [Start moving!]
 if <<(video (motion v) on (Stage v)) > [30]> and <(loudness) > [30]>> then
  say [Party!]

See Also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.