okay i have an empty object that produces a random object it works but i keep getting an error when editing other scripts and saving ill post it all now so you can see
using UnityEngine;
using System.Collections;
public class ProduceRandomObj : MonoBehaviour
{
public GameObject[] objects;
public GameObject emptyObject;
public int numberOfPlacedObj = 0;
public int randomNum;
void Start ()
{
if(numberOfPlacedObj <= 1)
{
GameObject newObject;
randomNum = Random.Range(1, 36);
newObject = (GameObject)Instantiate(objects[randomNum], emptyObject.transform.position, Quaternion.Euler(270,0,0));
Destroy(emptyObject);
numberOfPlacedObj++;
}
}
}
so basicly it picks a random number then transforms the empty object to the new item.
[b]here the error[/b]
Assets/C# Scripts/ProduceRandomObj.cs(16,36): warning CS0219: The variable `newObject’ is assigned but its value is never used – this error is the normal error
[b]here it is again when it stops me playing or building game[/b]
Internal compiler error. See the console log for more information. output was:Assets/C# Scripts/ProduceRandomObj.cs(16,36): warning CS0219: The variable `newObject’ is assigned but its value is never used
Unhandled Exception: System.UnauthorizedAccessException: Access to the path “C:\Users\splet_000\Documents\Tasteless Marble Maze 3D\Temp\Assembly-CSharp.dll.mdb” is denied.
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in :0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in :0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in :0
at Mono.CompilerServices.SymbolWriter.MonoSymbolWriter.WriteSymbolFile (Guid guid) [0x00000] in :0
at Mono.CSharp.SymbolWriter+SymbolWriterImpl.WriteSymbolFile () [0x00000] in :0
at Mono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in :0
at Mono.CSharp.CodeGen.Save (System.String name, Boolean saveDebugInfo, Mono.CSharp.Report Report) [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0
what can i do to fix this problem 🙂



