Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

GameObject.Instantiate won't clone an object reference

$
0
0
Hi everyone,

I have a script called "TestObject1" attached to an empty GameObject in the scene.

Code (CSharp):
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class TestObject1 : MonoBehaviour {
  5.  
  6.     public object var;
  7.     public float var2 = 0f;
  8.  
  9.     // Use this for initialization
  10.     void Start () {
  11.         Debug.Log (var);
  12.         Debug.Log (var2);
  13.     }
  14.    
  15.     // Update is called once per frame
  16.     void Update () {
  17.         if(Input.GetMouseButtonDown(0))
  18.         {
  19.             var =...
GameObject.Instantiate won't clone an object reference

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>