Detecting direction using the camera in Scratch is a very useful tool for controlling our sprite using movement. Now you will learn how it functions and how to use it!
- 24 Mar 2020
The block for detecting directions in Scratch only returns the direction in which anything directly below the object you are programming is moving.
The block we are referring to is found amongst the commands in the "Video Sensing" section:
If you do not have the "Video Sensing" section, follow this link and you will find instructions on how to find it.
This block is detecting movement right now, not direction. In order for it to detect direction, you need to click on "movement" and select "direction" from the drop-down menu:
On its own, this block is not a command (instruction), which is why it does not have the shape of a block that can be attached to your program. Instead, it can be placed onto another block, in the place of a number.
The video above is an example of how you can place the direction detection block inside of a point to direction block. This way the rotation block will rotate the sprite in the direction chosen by the direction detection block and the camera.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons