Time for action – configuring the fruit as a sensor
The game file to import and load for this session is 5961_03_10.stencyl
.
We'll start by setting up the banana actor as a sensor:
Display the banana actor in the Animation Editor (click on the Dashboard tab, then Actor Types, and double-click on the Stencyl Book Banana thumbnail).
Ensure that the Collision button is selected in the row of buttons at the upper-center of the screen.
Click on the left collision circle on the banana so that it is selected.
In the right panel, under the heading Physical Properties, click on the Is a Sensor? option so that a checkmark is shown as follows:
Click on the right collision circle on the banana so that it is selected.
Click on the Is a Sensor? option so that a checkmark is shown.
Click on the Physics button in the row of buttons at the upper-center of the screen.
Change the Affected by Gravity? setting to No.
Test the game; make the monkey collide with the banana (it will run through it)!
What just happened?
We...