# 「「他のオブジェクトとの距離」条件がトリガーされない問題についての相談」//「「他のオブジェクトとの距離」条件がトリガーされない問題についての相談」//「‘Distance to Other Object’ Condition Not Triggering — Need Help」

**URL:** https://guild.rpgmakerofficial.com/t/topic/599
**Category:** 質問
**Tags:** 日本語, english, 中文
**Created:** [2025 年 7 月 17 日午前 5:50 UTC](https://guild.rpgmakerofficial.com/t/topic/599 "2025-07-17T05:50:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![bigcake](https://avatars.discourse-cdn.com/v4/letter/b/ebca7d/32.png) [@bigcake](https://guild.rpgmakerofficial.com/u/bigcake)
#### Post date: [2025 年 7 月 17 日午前 5:50 UTC](https://guild.rpgmakerofficial.com/t/topic/599/1 "2025-07-17T05:50:23Z")

</div>

![1](https://us1.discourse-cdn.com/flex002/uploads/rpgmaker_community/original/2X/c/cc45779d1b3e448159304bb761c2dcd441a41b2d.png)

.

 ![2](https://us1.discourse-cdn.com/flex002/uploads/rpgmaker_community/original/2X/3/3cc4c075943060b5997040c7b943d3e77dd22423.png)  
.

「みなさん、お世話になっております。

現在、以下の仕様を実装中でハマっています…

■ 実装済み（動作 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!”

///

目前测试，我在对象里面创建图块创建对象（类似区块，区域）做成一个大地形，

可以随机变换，地形碰撞，还有在对象里面的敌人受击碰撞可以被打到，

但是在行动里的与其他对象距离这个条件无法触发，请问有没有什么方法喵？

---

<div class="post-metadata">

### Author: ![Justus](https://sea2.discourse-cdn.com/flex002/user_avatar/guild.rpgmakerofficial.com/justus/32/55_2.png) [@Justus](https://guild.rpgmakerofficial.com/u/Justus)
#### Post date: [2025 年 7 月 17 日午後 12:36 UTC](https://guild.rpgmakerofficial.com/t/topic/599/2 "2025-07-17T12:36:02Z")

</div>

再現可能な最小限のプロジェクトと再現手順はありますか？
