.
.
「みなさん、お世話になっております。
現在、以下の仕様を実装中でハマっています…
■ 実装済み(動作 OK)
- 「オブジェクト内にタイル / 領域を作成」してランダム地形を生成 → 地形の衝突判定(Collision)正常動作。
- 同オブジェクト内の敵も「被ダメージ時の衝突」は検知される → 攻撃が当たるのは確認済み。
■ 不具合(条件が反応しない)
「アクション設定」の 「他オブジェクトとの距離」条件 が全くトリガーされません。例えば:
- プレイヤーと敵の距離が一定以内に入っても、「距離条件でイベント発火」しない。
- 地形オブジェクトとアイテムの距離判定も全く反応しない。
■ 確認した点
- オブジェクトの階層: terrain_root 配下に地形 / 敵を配置(衝突は効いているので階層自体は問題なし?)。
- コライダー / マスク: 衝突判定用の設定は揃っている(敵に HitArea2D、プレイヤーに AttackArea2D 等)。
Roguelike ゲームで「敵が一定距離でプレイヤーを察知する」「アイテムが近づいたら演出する」等の仕様を実装したいので、この距離条件のトラブルを解消したいです。
どなたか原因や対処法をご存知の方、教えていただけると助かります!
///
“Hi everyone,
I’m stuck on a problem while implementing these features:
■ Working Correctly
- Generated random terrain by ‘creating tiles/regions inside an object’ → Terrain collision (Collision) works.
- Enemies in the same object also detect ‘hit collisions’ → Attacks land as expected.
■ Bug: Condition Not Triggering
The ‘distance to other object’ condition in action settings never triggers. Examples:
- Even if the player gets within range of an enemy, the ‘distance condition event’ doesn’t fire.
- Distance checks between terrain objects and items also do nothing.
■ What I’ve Checked
- Hierarchy: Placed terrain/enemies under
terrain_root
(collision works, so hierarchy itself seems fine?). - Colliders/Masks: All collision settings are set (enemies have HitArea2D, player has AttackArea2D, etc.).
I’m making a Roguelike and need ‘enemies detect player at range’ and ‘items trigger effects when approached’. Please help fix this distance condition issue!
Env: [Add Godot version, tool versions, etc.]
Thanks!”
///
目前测试,我在对象里面创建图块创建对象(类似区块,区域)做成一个大地形,
可以随机变换,地形碰撞,还有在对象里面的敌人受击碰撞可以被打到,
但是在行动里的与其他对象距离这个条件无法触发,请问有没有什么方法喵?