mirror of
https://github.com/Relintai/godot-steering-ai-framework.git
synced 2024-11-18 09:07:18 +01:00
Fix spec. agents at position 0,0,0 on first frame
This commit is contained in:
parent
ca1a7088c5
commit
4d4c7213ba
@ -15,6 +15,7 @@ This document lists new features, improvements, changes, and bug fixes in every
|
||||
|
||||
- KinematicBody2DAgents and KinematicBody3DAgents that moved fast enough no longer reverse velocity suddenly during a frame where no acceleration is applied.
|
||||
- Specialized Agents like RigidBody2DAgent should no longer crash due to a missing reference.
|
||||
- Specialized physics agents no longer believe they are at 0,0,0 on the first frame.
|
||||
|
||||
## Godot Steering AI Framework 2.1.0
|
||||
|
||||
|
@ -23,7 +23,7 @@ func _init(_body: KinematicBody2D, _movement_type: int = MovementType.SLIDE) ->
|
||||
if not _body.is_inside_tree():
|
||||
yield(_body, "ready")
|
||||
|
||||
_body_ref = weakref(_body)
|
||||
self.body = _body
|
||||
self.movement_type = _movement_type
|
||||
|
||||
# warning-ignore:return_value_discarded
|
||||
|
@ -20,11 +20,10 @@ var _body_ref: WeakRef
|
||||
|
||||
|
||||
func _init(_body: KinematicBody, _movement_type: int = MovementType.SLIDE) -> void:
|
||||
body = _body
|
||||
if not _body.is_inside_tree():
|
||||
yield(_body, "ready")
|
||||
|
||||
self._body_ref = weakref(_body)
|
||||
self.body = _body
|
||||
self.movement_type = _movement_type
|
||||
|
||||
# warning-ignore:return_value_discarded
|
||||
|
@ -12,11 +12,10 @@ var _body_ref: WeakRef
|
||||
|
||||
|
||||
func _init(_body: RigidBody2D) -> void:
|
||||
body = _body
|
||||
if not _body.is_inside_tree():
|
||||
yield(_body, "ready")
|
||||
self.body = _body
|
||||
|
||||
_body_ref = weakref(_body)
|
||||
# warning-ignore:return_value_discarded
|
||||
_body.get_tree().connect("physics_frame", self, "_on_SceneTree_frame")
|
||||
|
||||
|
@ -11,11 +11,10 @@ var _last_position: Vector3
|
||||
var _body_ref: WeakRef
|
||||
|
||||
func _init(_body: RigidBody) -> void:
|
||||
body = _body
|
||||
if not _body.is_inside_tree():
|
||||
yield(_body, "ready")
|
||||
self.body = _body
|
||||
|
||||
_body_ref = weakref(_body)
|
||||
# warning-ignore:return_value_discarded
|
||||
_body.get_tree().connect("physics_frame", self, "_on_SceneTree_frame")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user