Tilt

From Castle Wiki

Tilt is an interactive behavior which causes the blueprint's actors to move in response to tilting the device.

You can add Tilt by opening the Inspector for a blueprint, navigating to the Movement tab, and pressing Add physics or controls. Make sure the blueprint already has Dynamic motion.

Used by itself, the tilt behavior causes actors to accelerate without any limits, which means that if someone holds their device at an angle, the actor will keep moving faster and faster, like a ball rolling down a hill. In order to make the movement easier to control, it's a good idea to combine tilt with Slow Down or Speed Limit.

Sometimes this device sensor is referred to as accelerometer.

Properties

  • Acceleration: How much acceleration to apply to the actor from the device tilt.
  • Axis: One of x and y, only x, or only y.

Using Tilt with Rules

  • Tilt can be enabled or disabled using the Enable/Disable behavior Response.
  • There are individual Expressions for Device Tilt X and Device Tilt Y that can be used to control other things instead of acceleration.