![](/img/trans.png)
[英]Unity Engine: 2D Rigid body is falling slowly after adding movement?
[英]Rigid body not stop at Platform unity engine
我使用rigidbody2d 移动平台
我的玩家也使用rigidbody2d进行控制
问题是当玩家跳入平台时他不能停留在平台上(滑动)
我的代码是
if (inHelecopter)
{
player.transform.SetParent(helecopter.transform,false);
}
else
{
player.transform.parent = null;
}
如何让它根据平台的位置在最后一帧中的变化来移动玩家对象,而不是作为玩家变换的父对象?
if (carryingPlayer)
{
player.transform.position += lastPosition - transform.position;
}
lastPosition = transform.position;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.