Difference between revisions of "Motion"
(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...") |
|||
Line 10: | Line 10: | ||
Internally, Castle uses [https://box2d.org/ Box2D], where fixed motion corresponds to a kinematic body and dynamic motion corresponds to a dynamic body. | Internally, Castle uses [https://box2d.org/ 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 |
Revision as of 06:05, 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