NavigationObstacle2D.xml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="NavigationObstacle2D" inherits="Node" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. 2D obstacle used in navigation for collision avoidance.
  5. </brief_description>
  6. <description>
  7. 2D obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. This can be done by having the obstacle as a child of a [Navigation2D] node, or using [method set_navigation]. [NavigationObstacle2D] is physics safe.
  8. Obstacles [b]don't[/b] change the resulting path from the pathfinding, they only affect the navigation agent movement in a radius. Therefore, using obstacles for the static walls in your level won't work because those walls don't exist in the pathfinding. The navigation agent will be pushed in a semi-random direction away while moving inside that radius. Obstacles are intended as a last resort option for constantly moving objects that cannot be (re)baked to a navigation mesh efficiently.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="get_navigation" qualifiers="const">
  14. <return type="Node" />
  15. <description>
  16. Returns the [Navigation2D] node that the obstacle is using for its navigation system.
  17. </description>
  18. </method>
  19. <method name="get_rid" qualifiers="const">
  20. <return type="RID" />
  21. <description>
  22. Returns the [RID] of this obstacle on the [Navigation2DServer].
  23. </description>
  24. </method>
  25. <method name="set_navigation">
  26. <return type="void" />
  27. <argument index="0" name="navigation" type="Node" />
  28. <description>
  29. Sets the [Navigation2D] node used by the obstacle. Useful when you don't want to make the obstacle a child of a [Navigation2D] node.
  30. </description>
  31. </method>
  32. </methods>
  33. <members>
  34. <member name="estimate_radius" type="bool" setter="set_estimate_radius" getter="is_radius_estimated" default="true">
  35. Enables radius estimation algorithm which uses parent's collision shapes to determine the obstacle radius.
  36. </member>
  37. <member name="radius" type="float" setter="set_radius" getter="get_radius" default="1.0">
  38. The radius of the agent. Used only if [member estimate_radius] is set to [code]false[/code].
  39. </member>
  40. </members>
  41. <constants>
  42. </constants>
  43. </class>