add_ray 添加射线(传感器)

add_ray(entity_id u32, name String, direction String, distance f32, target_type String, px f32, py f32, pz f32, gizmos_open f32);

输入参数

  • entity_id 实体索引
  • name 当前实体下为传感器的名称
  • direction 射线方向 R(右) L(左) F(前) B(后)
  • distance 检测距离
  • target_type 目标体
  • px 位置偏置x
  • py 位置偏置x
  • pz 位置偏置z
  • gizmos_open 调试部件显示开关

输出参数

例子

// 给当前实体下名为Tool添加传感器,识别抓取手爪或工件
add_ray(entity.index,"Tool","R",0.51,"",0.0,0.0,0.0,true);
作者:力博特  创建时间:2025-09-13 11:33
最后编辑:力博特  更新时间:2025-11-11 18:53