猫史档案馆


超级干货!!!瞬移到鼠标所指位置的代码!!!!!!!!!!!!

用户:编程梦想家编程梦想家查看:4 回复:3 评论:4 创建时间:2021-06-03T12:33:00


world.onPress(async({ button, entity,raycast: { voxelIndex, normal} }) => {    
if (button == Box3ButtonType.ACTION0) {//如果是action0,对应电脑端左键         
let v = voxelIndex.add(normal);//用点击到的方块坐标加上法向量,得到邻边方块位置            
if ((voxels.getVoxel(v.x, v.y, v.z)) == (voxels.name('null'))) {
        entity.position.set(v.x, v.y+2, v.z)
};         };     })


回复

上一页1 页 / 共 1下一页
yuansyuans

饿,很简单啊(在信息科课上发帖)你得在a喵上增加两次(老师来l

点赞0


评论


难起的名字难起的名字

emotion_编程猫_点赞

点赞1


评论


治愈绾兮治愈绾兮

我早发过了https://shequ.codemao.cn/community/366902

点赞0


评论