
Lv.1
在 [求助]如何让一个模型面向玩家 中回复
我不清楚。
if(e.target && !e.target.destroyed){
var direction = e.target.position.sub(zomPos);
var dist = direction.mag()
var speed = 0.2+Math.random()*0.3
e.velocity.x = direction.x*speed/dist
e.velocity.z = direction.z*speed/dist
var orientation = Quat.rotateY(Math.atan2(e.velocity.z, e.velocity.x))
e.meshOrientation.copy(orientation)
}
是这个吗?
2021-05-07T19:54:10 点赞:1