Difference between revisions of "Motion"

From Castle Wiki
Line 12: Line 12:


== Initial Motion Parameters ==
== Initial Motion Parameters ==
= X Velocity =
=== X Velocity ===
the initial velocity of the object in its X axis when it's created
the initial velocity of the object in its X axis when it's created
= Y Velocity =
=== Y Velocity ===
the initial velocity of the object in its Y axis when it's created
the initial velocity of the object in its Y axis when it's created
= Rotational Velocity =
=== Rotational Velocity ===
the initial rotational velocity of the object when it's created
the initial rotational velocity of the object when it's created
= Density =
=== Density ===
the mass of the object
the mass of the object
<h1>HTML MARKUP TEST </h1>

Revision as of 06:08, 7 July 2022

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.

Initial Motion Parameters

X Velocity

the initial velocity of the object in its X axis when it's created

Y Velocity

the initial velocity of the object in its Y axis when it's created

Rotational Velocity

the initial rotational velocity of the object when it's created

Density

the mass of the object

HTML MARKUP TEST