Download Download
Godot Feature Splash
Godot Addon API Docs
CharacterAI — API

Properties

  • Node3D BOUNDS
  • Vector3[] path_points = []
  • int current_path_index = 0
  • float path_timer = 0.0
  • float path_update_interval = 10.0
  • float visit_distance = 0.2
  • float distance_threshold = 4.0
  • Vector3[] available_waypoints = []
  • Array[] perimeter_boundary = []
  • PackedVector3Array bounds_vertices = []
  • Array[] bounds_edges = []
  • Vector2 bounds_min
  • Vector2 bounds_max
  • float max_speed = 0.5
  • float min_speed = 0.1
  • float speed_distance_threshold = 2.0
  • Vector2 current_movement_direction = Vector2(0, 0)
  • float direction_change_threshold = 0.3
  • float stuck_detection_timer = 0.0
  • float stuck_check_interval = 2.0
  • Vector2 last_position = Vector2(0, 0)
  • float min_expected_movement = 0.1
  • bool is_idling_between_points = false
  • float idle_timer = 0.0
  • float idle_duration = 3.0
  • float direction_change_timer = 0.0
  • float direction_change_interval = 2.0
  • Vector2 current_input = Vector2(0, 0)
  • float stuck_threshold_time = 3.0

Methods

  • void _ready()
  • void _physics_process(float delta)
  • void _move_towards_current_target(float delta)
  • void _pick_new_path()
  • Vector3 _find_next_waypoint_in_range(Vector3 from_point, Vector3[] candidates)
  • void _analyze_bounds_mesh()
  • void _extract_vertices_and_edges_from_mesh(MeshInstance3D mesh_instance)
  • void _add_edge(int v1, int v2)
  • void _detect_perimeter_boundary()
  • void _count_edge_usage(Dictionary edge_count, int v1, int v2)
  • void _generate_pathfinding_waypoints()
  • bool _is_point_inside_shape(Vector2 point)
  • bool _is_point_inside_perimeter_polygon(Vector2 point)
  • Vector2[] _get_ordered_perimeter_points()
  • bool _is_point_safely_inside_perimeter(Vector2 point, float safety_margin = 0.5)
  • float _distance_point_to_line_segment(Vector2 point, Vector2 line_start, Vector2 line_end)
  • bool _path_crosses_perimeter(Vector3 point1, Vector3 point2)
  • bool _line_segments_intersect_robust(Vector2 p1, Vector2 q1, Vector2 p2, Vector2 q2)
  • int _orientation(Vector2 p, Vector2 q, Vector2 r)
  • bool _point_on_segment_robust(Vector2 p, Vector2 q, Vector2 r)
  • Vector3 _find_nearest_waypoint_to_position(Vector3 position)
  • Node _find_node_by_name(Node node, String name)
  • void _pick_new_direction()