动作不能停止
我一直在做游戏,您可以上楼,当您按W Movetowards
时,您会在楼梯的中间移动您。一切正常,但是当动画停止时,我无法停止Movetowards,并且玩家位于楼梯的中间。但是movetowards
仍然将我拉到里面,玩家无法移动。
这是拉动播放器的代码:
if(entered == 1 && klikw == 1)
{
col.SetActive(true);
Vector3 a = transform.position;
Vector3 b = location.position;
transform.position = Vector3.MoveTowards(a, b, speed);
animator.SetFloat("whenhewalk", 1);
}
klikw是当玩家单击w时
I have been making game in which you can go upstairs and when you press w MoveTowards
will move you in the middle of stairs. Everything is working perfectly but i cant stop MoveTowards when animation stops and player is in middle of stairs. But MoveTowards
still pulls me inside and player can´t move.
This is code that pulls player:
if(entered == 1 && klikw == 1)
{
col.SetActive(true);
Vector3 a = transform.position;
Vector3 b = location.position;
transform.position = Vector3.MoveTowards(a, b, speed);
animator.SetFloat("whenhewalk", 1);
}
klikw is when player clicks w
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
float Incelistance = 1.2F;
float minDistance = 1.2f;