我想让我的剑绑定到玩家但是当我点击播放并移动我的角色时,剑只是移动了一个浮点值,然后突然回到它的原始位置(0,0,0)。我还想添加剑偏移。
代码:
public GameObject Player;
public GameObject Self;
public Vector3 SwordOffset;
void FixedUpdate ()
{
Self.transform.position = Player.transform.postion;
//I have not added the offset yet.
}