AnimatableBody2D.xml 1.3 KB

1234567891011121314151617
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AnimatableBody2D" inherits="StaticBody2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. A 2D physics body that can't be moved by external forces. When moved manually, it affects other bodies in its path.
  5. </brief_description>
  6. <description>
  7. An animatable 2D physics body. It can't be moved by external forces or contacts, but can be moved manually by other means such as code, [AnimationMixer]s (with [member AnimationMixer.callback_mode_process] set to [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [RemoteTransform2D].
  8. When [AnimatableBody2D] is moved, its linear and angular velocity are estimated and used to affect other physics bodies in its path. This makes it useful for moving platforms, doors, and other moving objects.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <members>
  13. <member name="sync_to_physics" type="bool" setter="set_sync_to_physics" getter="is_sync_to_physics_enabled" default="true">
  14. If [code]true[/code], the body's movement will be synchronized to the physics frame. This is useful when animating movement via [AnimationPlayer], for example on moving platforms. Do [b]not[/b] use together with [method PhysicsBody2D.move_and_collide].
  15. </member>
  16. </members>
  17. </class>