Unity3D克隆对象没有显示在游戏选项卡上,但我可以在场景选项卡上看到所有克隆对象


public GameObject arrow;
public float launchForce;
public Transform shotPoint;                  
if (Input.GetMouseButtonDown(0))
{
shoot();
}   
private void shoot()
{
GameObject newArrow = Instantiate(arrow, shotPoint.position, shotPoint.rotation);
newArrow.GetComponent<Rigidbody2D>().velocity = transform.right * launchForce;
}

当我点击左键时,程序复制箭头,我可以在场景选项卡中看到它们,但在游戏选项卡中看不到它们。

如何在游戏选项卡中显示箭头?

2D和箭头对象有Rigidbody2D Box Collider.

如果您在场景选项卡中看到它们,则箭头也必须创建。我猜是位置设置不正确。你看过这个吗?

最新更新