Issues with Generating the Environment Dynamically - Liam-Higgins2018/Group_Project GitHub Wiki
Issues with Generating the Environment Dynamically
After our initial merge of the project, I began to work on the prefabManager script to allow the tracks I made to be randomly selected and instantiated on the scene.
While working on this script I noticed that my GameObject that I was using to get the position of the player on the map couldn't see the GameObject of the player character. Through a bit of trial and error and researching how others online went about solving this problem, I was able to get both GameObjects to see each other on the scene.
This allowed me to instantiate tracks in the environment based on the the character location. But as testing and playing the game I noticed that I would get an OutOfMemory exception. I decided that how I will fix this will be to delete every track that the player had already passed to consume less memory space. I would do this by setting each track that the player had passed to index 0 in my list of tracks. I would then delete and destroy each track that index value was 0.
By Liam Higgins