简体   繁体   English

Unity 克隆不会出现

[英]Unity clone won't appear

I'm new to coding and i'm trying to spawn a clone of a ball in unity, but it won't appear.我是编码新手,我正在尝试统一生成一个球的克隆,但它不会出现。 It does spawn at the spawn point but it doesn't appear.它确实会在生成点生成,但不会出现。

Here is my code:这是我的代码:

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

public class GameController : MonoBehaviour
{

    public GameObject ball;
    public Transform spawnPoint;

    // Start is called before the first frame update
    void Start()
    {
        SpawnBall();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    void SpawnBall()
    {
        Instantiate(ball, spawnPoint.position, Quaternion.identity);
    }

}

Edit: it's a 3d game and the mesh renderer is enabled.编辑:这是一个 3d 游戏,并且启用了网格渲染器。

Okay nevermind: i just redid the ball and it worked.好吧,没关系:我只是重做了球,它奏效了。

¯_(ツ)_/¯ ¯_(ツ)_/¯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM