hi guys im trying to remake flappy bird game and im using a script for obsticales, the problem is i dont have any public variables in my inspector,i had noticed this before in all of my other scripts but i didnt have to use it till now plz help. im new to this program and i helpd myself making this with yt video and that guy had all of the variables.
hers my script:
using UnityEngine;
using System.Collections;
public class Obstacle_Controller : MonoBehaviour {
%|2116635997_1|%
%|654900027_2|%
%|-1923297508_2|%
%|-249822339_3|%
%|1839940754_4|%
%|-571019068_5|%
%|-925286270_7|%
%|229520388_8|%
%|-1397955257_6|%
%|1658778628_7|%
%|1945534295_8|%
%|1595385029_9|%
%|240760436_13|%
%|-1351828713_14|%
%|-538521327_10|%
%|-1886464121_11|%
%|1777882437_17|%
%|-1467178245_18|%
%|-1364347592_12|%
%|-1365464219_13|%
count = Random.Range (1,7);
if (col.gameObject.tag == "Obstacles"){
%|1835605229_16|%
%|-1226015585_17|%
%|94116940_25|%
%|-1730366089_26|%
%|178054264_18|%
if (count == 2)
%|-45832522_20|%
%|-1758871415_30|%
%|-2138552915_21|%
%|-1748386806_22|%
%|1291776193_33|%
{
%|963389808_35|%
%|-1326176006_36|%
%|-157612183_24|%
%|-451700603_25|%
%|-875600075_39|%
%|627005122_40|%
%|-1811867867_41|%
%|990274629_26|%
%|2103199440_27|%
%|50192590_28|%
%|1964497193_45|%
%|1635644867_46|%
%|-743895130_29|%
%|443509859_30|%
%|-1379477984_49|%
Instantiate (obj6, obj_Position.transform.position, Quaternion.identity);
%|337091370_32|%
%|-2064717293_33|%
%|931388190_34|%
%|-847096881_35|%
%|165200921_36|%
%|1124787103_37|%
%|-1111419140_57|%
}
using UnityEngine;
using System.Collections;
public class Obstacle_Controller : MonoBehaviour {
public GameObject obj1;
public GameObject obj2;
public GameObject obj3;
public GameObject obj4;
public GameObject obj5;
public GameObject obj6;
public GameObject obj7;
public GameObject obj_Position;
int count=0;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D (Collider2D col)
{
count = Random.Range (1,4);
if (col.gameObject.tag == "Obstacles"){
if (count == 1)
{
Instantiate (obj1, obj_Position.transform.position, Quaternion.identity);
}
else
if (count == 2)
{
Instantiate (obj2, obj_Position.transform.position, Quaternion.identity);
}
else
if (count == 3)
{
Instantiate (obj3, obj_Position.transform.position, Quaternion.identity);
}
else
if (count == 4)
{
Instantiate (obj4, obj_Position.transform.position, Quaternion.identity);
}
else
if (count == 5)
{
Instantiate (obj5, obj_Position.transform.position, Quaternion.identity);
}
else
if (count == 6)
{
Instantiate (obj6, obj_Position.transform.position, Quaternion.identity);
}
else
if (count == 7)
{
Instantiate (obj7, obj_Position.transform.position, Quaternion.identity);
}
}
}