
Lv.1
吹过的风就让它散去吧
签名: 散会
在 [教程]如何做出像故宫开车一样的变身效果 中回复
world.querySelectorAll('.跑车').forEach((e)=>{
e.onEntityContact(({entity,other})=>{
if(!other.isPlayer){return}
other.mesh=entity.mesh;//设置玩家的外观
other.meshScale=entity.meshScale;//设置玩家的大小
other.player.invisible=true;//影身
other.meshOrientation = new Box3Quaternion(0, 1, 0, 0);//设置跑车的旋转角度,没有反不要这个代码
world.say(other.player.name+" 开启了敞篷跑车");//广播消息
other.player.runSpeed = 2;//设置跑步的速度
other.player.walkSpeed = 1.5;//设置走路的速度
other.player.scale =0.6;//因为实体比较小,设置玩家的大小小一些
other.player.jumpPower = 0;//关闭跳跃能力
});
});
这个代码应该会比较全面!
2020-04-15T14:05:23 点赞:0
在 地图建设招人啦! 中回复
创作地址:https://box3create.codemao.cn/games/b013d47821afe7a9c560
2020-04-16T09:52:25 点赞:0
在 [教程]如何做出像故宫开车一样的变身效果 中回复
//还原代码
world.querySelectorAll('.thp')/*标签名称*/.forEach((e)=>{//触发机制
e.onEntityContact(({entity,other})=>{
if(!other.isPlayer){return} //检测
other.mesh=other; //还原自己的造型
other.player.invisible=false;//隐身解除
other.player.canFly = false;//飞行解除
other.player.scale = 1;//大小还原
world.say(other.player.name+"还原了自己");//广播信息
});
});
2020-04-17T13:21:24 点赞:0