- Home /
LiGoSpawn not working,LiGoSpawn not working?????
I am currently trying to make a game that uses Dani's grappling hook, Dani's movement, and the random generation code in Islanders. (i forgot where i got it) but im getting this weird error but along with that I start just flying aimlessly in a trance with the randomly generated gameobject. im not sure how to really explain this but i hope if just the error that is popping up will be fixed, the weird stuff will go away. here is my code:
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class test : MonoBehaviour { public List liGoSpawn = new List();
void Start()
{
GameObject goToSpawn = liGoSpawn[Random.Range(0, liGoSpawn.Count)];
Instantiate(goToSpawn, transform.position, Quaternion.identity);
Destroy(gameObject);
}
}
and here is the error:
UnassignedReferenceException: The variable liGoSpawn of test has not been assigned. You probably need to assign the liGoSpawn variable of the test script in the inspector. UnityEngine.Object.Internal_InstantiateSingle (UnityEngine.Object data, UnityEngine.Vector3 pos, UnityEngine.Quaternion rot) <0x23eb2f2b930 + 0x00062> in :0 UnityEngine.Object.Instantiate (UnityEngine.Object original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:202) UnityEngine.Object.Instantiate[T] (T original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) (at C:/buildslave/unity/build/Runtime/Export/Scripting/UnityEngineObject.bindings.cs:276) test.Start () (at Assets/test.cs:12)
also i have a side problem, but I don't expect this to be answered; i'll have to figure it out myself, but anyway, I clip through the wall when using the grappling hook on a wall. smh whatever. thank you to anyone who replies!
Your answer
Follow this Question
Related Questions
Movement Issue: x value of object resets automatically 0 Answers
Jet-Pack Script 1 Answer
Charactercontroller won't go down, only goes up 1 Answer
Visualize a trajectory of a drone flight? 3 Answers
Root Motion android device problem 0 Answers