[英]Unity3D cloned object doews not show up on the game tab but I can see all the clones on the scene tab
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;
}
When I click the left button the program clones the arrows and I can see them in scene tab but I can't see them in the game tab.当我单击左键时,程序会克隆箭头,我可以在场景选项卡中看到它们,但在游戏选项卡中看不到它们。
How I can show arrows in the game tab?如何在游戏选项卡中显示箭头?
That is 2D and the arrow object have the Rigidbody2D Box Collider
.那是2D ,箭头 object 有
Rigidbody2D Box Collider
。
if you see them in the scene tab, the arrows must have been created as well.如果您在场景选项卡中看到它们,则箭头也必须已创建。 i would guess that the positions are not set correctly.
我猜想位置设置不正确。 Have you ever checked this?
你检查过这个吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.