用户:
精神I病院广东省分院院长查看:7 回复:1 评论:7 创建时间:2022-12-31T10:10:16
qwq
要让玩家自动前进
var angle = Math.atan2(player.facingDirection.z, player.facingDirection.x)
entity.velocity.set(
Math.cos(angle) * Math.cos(-player.cameraPitch) * speed,
Math.sin(-player.cameraPitch) * speed,
Math.sin(angle) * Math.cos(-player.cameraPitch) * speed,
)
但结果玩家的facingDirection就变成velocity的方向了
有没有什么办法就不让velocity影响玩家