admin管理员组

文章数量:1130349

碰撞后抖动问题的解决:

因为人物添加了Box Collider 2D 和刚体,因此当碰撞后会模拟实际的运动情况,和其它碰撞体碰撞后会发生抖动;

解决方法:

通过刚体控制物体的运动和位置,而不是通过 transfrom.position 来获得物体的位置并更新;

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
   
   
    public fl

碰撞后抖动问题的解决:

因为人物添加了Box Collider 2D 和刚体,因此当碰撞后会模拟实际的运动情况,和其它碰撞体碰撞后会发生抖动;

解决方法:

通过刚体控制物体的运动和位置,而不是通过 transfrom.position 来获得物体的位置并更新;

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
   
   
    public fl

本文标签: 人物unity