Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by D3mon1zA · Nov 09, 2015 at 01:03 PM · scripting problemscriptingbasics

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?

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image D3mon1zA · Nov 09, 2015 at 06:03 AM 0
Share

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

avatar image Jessespike D3mon1zA · Nov 09, 2015 at 04:26 PM 0
Share

Paste your entire script. It's likely a syntax error.

avatar image Dave-Carlile D3mon1zA · Nov 09, 2015 at 04:29 PM 0
Share

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.

avatar image AngryTilde · Nov 09, 2015 at 01:16 PM 0
Share

Have you tried running unity as ad$$anonymous$$istrator?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Acceleration issue 0 Answers

How do I make a script wait X time? 1 Answer

Interchangeable animations in a script? 0 Answers

Should I inherit from Monobehaviour if the use of my C# script is only to hold script references? 2 Answers

Set public gameobject by raycast hit target 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges