オペレーティングシステムまたはデバイス-Godotバージョン:
Windows 10 x64-Godot 2.1.2.stable.official
問題の説明:
move()を使用してKinematicBody2Dを移動した後、Collider変換は更新されません。
すべての動きは、最初のコライダーの位置/変形でのみテストされます。
再現する手順:
func _ready():
set_fixed_process(true)
func _fixed_process(delta):
move(Vector2(0, 100))
move(Vector2(100, 0))
set_fixed_process(false)
Aは下に移動するだけで、右には移動しません。
下に移動した後でも、AはBの下に収まります。
それはBの下にあり、L字型に移動している必要があります(最初に下に、次に右に)。
移動はコライダーを新しい位置に更新しないため、右に移動しようとしている間、右に移動した場合と同様に、Bによってブロックされているように見えます。
回避策:
_fixed_processを次のように変更します。
func _fixed_process(delta):
move(Vector2(0, 100))
var st = get_shape_transform(0) # get current shape transform, assuming we only have 1 shape
st.o += get_travel() # add move translation to shape transform
set_shape_transform(0, st) # update shape transform
move(Vector2(100, 0))
# you should reset the shape transform to its original state befor returing
set_fixed_process(false)
これは#7951と重複していると思いますが、 @ RandomShaperに確認してもらいたい:smiley:
はい、同じ問題です。
私はそれを逃した。
ありがとう。
最も参考になるコメント
これは#7951と重複していると思いますが、 @ RandomShaperに確認してもらいたい:smiley: