Answers for "destroying assets is not permitted to avoid data loss"

2

destroying assets is not permitted to avoid data loss

This is because the variable obstacle is referencing the asset.
What you need to do, is change

Instantiate(obstacle, new Vector3(x * 7.5f, y, z),Quaternion.identity);

to

obstacle = (GameObject) Instantiate(obstacle, new Vector3(x * 7.5f, y, z),Quaternion.identity);

Instead of destroying the instantiated object you were trying to destroy,
you were actually attempting to destroy the original due to not assigning 
obstacle as the instantiated object.
Posted by: Guest on May-17-2020

Code answers related to "destroying assets is not permitted to avoid data loss"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language