Learner Scripter... trying to make a basic move function.
ok so my script looks like this so far
using UnityEngine;
using System.Collections;
public class Move : MonoBehaviour
{
public float MoveSpeed = 10f;
void start ()
{
}
void Update ()
{
if (Input.GetKeyDown (KeyCode.W)) {
Transform.Translate (Vector3.forward * MoveSpeed * Time.deltaTime)
}
}
}
njow when I try to run the script in Unity it comes up with : Assets/Move.cs(15,17): error CS1525: Unexpected symbol `}' and Assets/Move.cs(18,1): error CS8025: Parsing error
please does anybody know what I have done wrong?
ok, I have fixed those compiler errors : //$$anonymous$$ove Forward if (Input.Get$$anonymous$$eyDown ($$anonymous$$eyCode.UpArrow)) gameObject.transform.Translate (Vector3.forward moveSpeed Time.deltaTime); //$$anonymous$$ove Backwards if (Input.Get$$anonymous$$eyDown ($$anonymous$$eyCode.DownArrow)) gameObject.transform.Translate (-Vector3.forward moveSpeed Time.deltaTime);
}
}
but now I get this...
Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\Users\Public\Documents\Unity Projects\scripting\Temp\Assembly-CSharp.dll.mdb" is denied.
at System.IO.FileStream..ctor (System.String path, File$$anonymous$$ode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in :0
at System.IO.FileStream..ctor (System.String path, File$$anonymous$$ode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in :0
at System.IO.FileStream..ctor (System.String path, File$$anonymous$$ode mode, FileAccess access) [0x00000] in :0
at $$anonymous$$ono.CompilerServices.SymbolWriter.$$anonymous$$onoSymbolWriter.WriteSymbolFile (Guid guid) [0x00000] in :0
at $$anonymous$$ono.CSharp.SymbolWriter+SymbolWriterImpl.WriteSymbolFile () [0x00000] in :0
at $$anonymous$$ono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in :0
at $$anonymous$$ono.CSharp.CodeGen.Save (System.String name, Boolean saveDebugInfo, $$anonymous$$ono.CSharp.Report Report) [0x00000] in :0
at $$anonymous$$ono.CSharp.Driver.Compile () [0x00000] in :0
at $$anonymous$$ono.CSharp.Driver.$$anonymous$$ain (System.String[] args) [0x00000] in :0
Paste your entire script. It's likely a syntax error.
Sometimes Unity is holding open a file, or you're running your game standalone and didn't close it and it's holding open the file. $$anonymous$$ake sure your game isn't running. Restart Unity. One of those should fix it. If not, reboot.
Have you tried running unity as ad$$anonymous$$istrator?
Answer by D3mon1zA · Nov 10, 2015 at 02:02 AM
Cheers guys. Have it sussed now. Had a couple of syntax errors. Then I had to close the script file in monodevelope and worked fine after that.
Your answer
![](https://koobas.hobune.stream/wayback/20220612044428im_/https://answers.unity.com/themes/thub/images/avi.jpg)