用户:
治愈绾兮查看:6 回复:3 评论:6 创建时间:2021-08-11T13:51:38
我先定义了一个实体
const tnt = world.createEntity({
mesh: 'mesh/TNT.vb',
meshScale: MeshScale,
collides: true,
gravity: true,
position: [
13 + Math.random() * 11,
16,
93 + Math.random() * 16,
],
});
然后,我用射线判断别人和实体的距离
world.querySelectorAll("player").forEach((entity) => {
tntshexian = world.raycast(tnt.position, entity.position)
world.say(tntshexian.distance)
})
结果,返回的值一直是0,这是哪里错了?
array_已退我虽然不知道,但是我猜:
const tnt = world.createEntity({
mesh: 'mesh/TNT.vb',
meshScale: [1/16,1/16,1/16], //改动
collides: true,
gravity: true,
position: [
13 + Math.random() * 11,
16,
93 + Math.random() * 16,
],
});点赞0
评论