Options
All
• Public
• Public/Protected
• All

# Class PathfindingRuntimeBehavior

PathfindingRuntimeBehavior represents a behavior allowing objects to follow a path computed to avoid obstacles.

## Methods

• activate(enable: boolean): void
• activated(): boolean
• allowDiagonals(allow: boolean): void
• destinationReached(): boolean
• diagonalsAllowed(): boolean
• euclideanDistance(a: FloatPoint, b: FloatPoint): number
• getAcceleration(): number
• getAngleOffset(): number
• getAngularMaxSpeed(): number
• getCellHeight(): number
• getCellWidth(): number
• getDestinationX(): number
• getDestinationY(): number
• getExtraBorder(): number
• getGridOffsetX(): number
• getGridOffsetY(): number
• getLastNodeX(): number
• getLastNodeY(): number
• getMaxSpeed(): number
• getMovementAngle(): number
• getName(): string
• getNameId(): number
• getNextNodeIndex(): number
• getNextNodeX(): number
• getNextNodeY(): number
• getNodeCount(): number
• getNodeX(index: number): number
• getNodeY(index: number): number
• getSpeed(): number
• isObjectRotated(): boolean
• manhattanDistance(a: FloatPoint, b: FloatPoint): number
• Compute and move on the path to the specified destination.

#### Returns void

• movementAngleIsAround(degreeAngle: number, tolerance: number): boolean
• onActivate(): void
• onCreated(): void
• Reimplement this to do extra work when the behavior is created (i.e: an object using it was created), after the object is fully initialized (so you can use `this.owner` without risk).

#### Returns void

• onDeActivate(): void
• onDestroy(): void
• This method is called when the owner of the behavior is being removed from the scene and is about to be destroyed/reused later or when the behavior is removed from an object (can happen in case of hot-reloading only. Otherwise, behaviors are just de-activated, not removed. See `onDeActivate`).

#### Returns void

• pathFound(): boolean
• setAcceleration(acceleration: number): void
• setAngleOffset(angleOffset: number): void
• setAngularMaxSpeed(angularMaxSpeed: number): void
• setCellHeight(height: number): void
• setCellWidth(width: number): void
• setExtraBorder(extraBorder: any): void
• setGridOffsetX(gridOffsetX: number): void
• setGridOffsetY(gridOffsetY: number): void
• setMaxSpeed(maxSpeed: number): void
• setRotateObject(allow: boolean): void
• setSpeed(speed: number): void
• Called at each frame after events. Call doStepPostEvents.

#### Parameters

• ##### instanceContainer: RuntimeInstanceContainer

The instanceContainer owning the object

#### Returns void

• Called at each frame before events. Call doStepPreEvents.

#### Parameters

• ##### instanceContainer: RuntimeInstanceContainer

The instanceContainer owning the object

#### Returns void

• updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
• Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.

#### Returns boolean

true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).

## Properties

name: string
type: string

Generated using TypeDoc
{"ft_lang_label":"__label__en","ft_lang_prob":0.8889323,"math_prob":0.7854006,"size":2190,"snap":"2022-40-2023-06","text_gpt3_token_len":457,"char_repetition_ratio":0.17017384,"word_repetition_ratio":0.18343195,"special_character_ratio":0.18538813,"punctuation_ratio":0.11809045,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97507536,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-03T03:24:55Z\",\"WARC-Record-ID\":\"<urn:uuid:ba9a4890-ac91-4692-b3dc-c36b37e1fe74>\",\"Content-Length\":\"125741\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0730f475-86f5-439d-835e-3fff895085f3>\",\"WARC-Concurrent-To\":\"<urn:uuid:a30ceca1-69db-41ae-bda3-9d6fcaabe253>\",\"WARC-IP-Address\":\"104.26.14.77\",\"WARC-Target-URI\":\"https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.PathfindingRuntimeBehavior.html\",\"WARC-Payload-Digest\":\"sha1:FZEWKBETJXPKMIXB36SEUT43TWA6NSYA\",\"WARC-Block-Digest\":\"sha1:FSUXQ7U7U43Q4TIQSKLVPGRUUAVZPBFR\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500042.8_warc_CC-MAIN-20230203024018-20230203054018-00109.warc.gz\"}"}