`physics-3d-collision`: Fast-Path 10 says raycasts ignore triggers by default — by default they hit triggers

未关闭 适合新手
#103 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
unity
领域
documentation

调研方向

阅读 skills/physics-3d-collision/SKILL.md,尤其是 Fast-Path 10 和 Step 3(第 108–112 行和第 335–341 行)。更正对 trigger 默认值的说明,并按照 issue 中建议的修复,为被 trigger volume 阻挡的射线添加反向 fast-path。两部分都准确描述默认值和每次调用的选项后即完成。

由索引模型根据 Issue 内容生成。

描述

Plugin: 0.1.8-beta (main @ 3831ddb) · Unity: 6000.6.7f1

Problem

skills/physics-3d-collision/SKILL.md:

  • L108–112, Fast-Path 10: "Cause: Physics.Raycast ignores triggers by default. Fix: pass QueryTriggerInteraction.Collide, or enable Queries Hit Triggers globally."
  • L335–341, Step 3, repeats it.

The default is the opposite, so the diagnosis is inverted: in a default project "enable Queries Hit Triggers" changes nothing. The common real symptom — a ray stopped by an invisible trigger volume — has no fast-path, and agents may write code that assumes triggers are skipped.

Evidence

Suggested fix

Fast-Path 10 / Step 3: "In a default project raycasts hit triggers (Queries Hit Triggers is on by default and UseGlobal follows it). If a trigger is missed, check whether the project turned Queries Hit Triggers off, the call passes QueryTriggerInteraction.Ignore, or the trigger is on the Ignore Raycast layer (excluded by Physics.DefaultRaycastLayers) or outside the layer mask."

Add the reverse fast-path: "Ray blocked by a trigger volume → pass QueryTriggerInteraction.Ignore on that call; prefer this per call over flipping the global setting."

主要语言
C#
星标
590
派生
67
平均合并
3 天 4 小时
30 天内合并 PR
13

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Unity-Technologies/unity-agent-plugin 的其他 Issue

查看 Unity-Technologies/unity-agent-plugin 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。