Motion

From Castle Wiki
Revision as of 20:01, 13 May 2022 by Ben (talk | contribs) (Created page with "'''Motion''' is a Behavior that allows Actors to move through Card space. == Using Motion == To add motion to a Blueprint, open the Inspector for th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Motion is a Behavior that allows Actors to move through Card space.

Using Motion

To add motion to a Blueprint, open the Inspector for that blueprint, navigate to the Movement tab, and change the Motion control to either Fixed or Dynamic. If you aren't sure which one you need, it's usually better to pick Dynamic. See below for more details on the differences between fixed and dynamic motion.

Fixed vs. Dynamic motion

Actors with Fixed Motion move at a constant rate; their velocity can never be changed by outside forces like Collisions. This can be useful if, for example, you want a windmill which always rotates the same way, or a cloud which drifts across the screen.

Actors with Dynamic Motion can change their velocity when they are acted on by external forces. This is usually what you want for any object where you expect it to have physics. In fact, dynamic motion is required to add interactive controls, such as Drag, and to change the way actors move through space, such as making them Slow Down.

Internally, Castle uses Box2D, where fixed motion corresponds to a kinematic body and dynamic motion corresponds to a dynamic body.