var r: geometry.Ray = geometry.Ray.create(0, 0, 0, 0, 0, -1);
//两种模式, 碰到物体就停止
if (PhysicsSystem.instance.raycastClosest(r)) {
let result: PhysicsRayResult = PhysicsSystem.instance.raycastClosestResult;
console.log("raycastClosestResult", result);
}
代码就这么简单, 物体只要设置成dynamic就返回不了结果, 更换物理引擎, 或者更换物体的为静态或者运动学就是好的, 这个BUG 已经存在3年了, 还不修复嘛?

我这边用raycastClosest测试了下,是可以检测到的呀。是不是有什么前提条件弄错了。还是我这边没弄对。
我用的就是bullet,刚体也是dynamic的类型。ray是用的相机 screenPointToRay 获取的。 确实可以检测的到。
我测试出来了。感觉是引擎的bug,或者说是里面的脚本调用顺序问题导致的。
还得是creator,小细节上狠狠拿捏我们。