Book Image

Stencyl Essentials

By : Richard Sneyd
Book Image

Stencyl Essentials

By: Richard Sneyd

Overview of this book

Table of Contents (20 chapters)
Stencyl Essentials
Credits
About the Author
Acknowledgements
About the Reviewers
www.PacktPub.com
Preface
Index

Coin collisions and physics settings


We now have all the visuals set up for our Coin actor. Next, we'll need to configure the physics settings. One thing we need to keep in mind is that, while we do want to be able to detect when the Player Character collides (overlaps) with a coin, we do not want him to react physically to this event (bounce, stop, slide, and so on). With this in mind, perform the following steps:

  1. In the context menu at the top of the Actor Type Editor, click on the Collisions tab.

  2. Stencyl has added a box collider by default. Leave it unaltered.

  3. Under Physics Properties, check Is a Sensor? to prevent the Player Character from reacting physically when it collides with one of the Coin actors. Sensors behave like triggers; a collision is detected when the collision box overlaps with another, but the physics engine doesn't react to this detected event.

  4. Switch to the Physics tab at the top of the context menu.

  5. Under General, set What Kind of Actor Type? to Cannot Move.