• 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 /
avatar image
0
Question by Simmojosh · Feb 25, 2015 at 05:19 PM · script error

The referenced script on this Behaviour is missing! but the script is there

i have created a script and assigned it to a object. when i click the script name in the component it highlights the correct script in my assets folder but i still get this error.

what is going on!

I have tried remaking the script the project and disabling my antivirus and none of these have worked.

I would be grateful for any assistance you can give.

Comment
Add comment · Show 2
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 fafase · Feb 25, 2015 at 05:19 PM 0
Share

Do you have a prefab of that object? Sometimes if the component is missing on the prefab it still shows like you describe.

avatar image maccabbe · Feb 25, 2015 at 06:41 PM 0
Share

Is the filename of the script the same as the class name of the script?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by dudester · Feb 25, 2015 at 05:39 PM

well your description doesn't help much but normally if in play mode and you delete an object as in destroy it you'll get an error like that also if the object doesn't exit as a prefab or doesn't exist in the scene you'll get that error to so start there first if you don't find the problem post here in the comments and I'll try help more.

Comment
Add comment · Show 1 · 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
avatar image Simmojosh · Feb 25, 2015 at 10:11 PM 0
Share

$$anonymous$$y apologies for being vague.

I have just started using unity with no other experience in game design but some coding experience.

I was trying the Roller Ball game tutorial (http://unity3d.com/learn/tutorials/projects/roll-a-ball) for the program and had just got to adding a controller for the ball. i created the script following the tutorial as follows:

using UnityEngine;

using System.Collections;

public class PlayerController : $$anonymous$$onoBehaviour

{ void FixedUpdate ()

 {

     float moveHorizontal = Input.GetAxis("Horizontal");

     float moveVertical = Input.GetAxis("Vertical");

     Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);

     rigidbody.AddForce(movement);

 }

}

after i had saved this and exited I hit play as he did and got this error.

Thanks for your help.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

all my scripts stopped working after i put a enemy spawner script in 0 Answers

HostListReceived symbol resolve 1 Answer

error CS1525: Unexpected symbol 'rigidbody' 1 Answer

C# script works wrong ( GUI ) How to fix it ? 1 Answer

Please. Help me out :( 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