Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
2 captures
11 Jun 22 - 14 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 /
avatar image
5
Question by shay4545 · Jul 27, 2015 at 10:47 PM · androidscripting problembuild-errorjoystick

Error on build

I get the following error when attempting to build:

 Assets/Scripts/Misc/Joystick.cs(129,41): error CS0115: `UnityEngine.UI.Joystick.OnValidate()' is marked as an override but no suitable method found to override

Here is the portion of the script it is referring to:

 protected override void OnValidate() {
             base.OnValidate();
             UpdateJoystickGraphic();
         }

What should I do to fix this? I attempted erasing override from the void, but I got a warning saying:

 Assets/Scripts/Misc/Joystick.cs(129,32): warning CS0114: `UnityEngine.UI.Joystick.OnValidate()' hides inherited member `UnityEngine.EventSystems.UIBehaviour.OnValidate()'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword


Comment
Add comment · Show 3
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 shay4545 · Jul 27, 2015 at 11:17 PM 0
Share

Then I get this error:

 Assets/Scripts/$$anonymous$$isc/Joystick.cs(130,30): error CS0117: `UnityEngine.EventSystems.UIBehaviour' does not contain a definition for `OnValidate'

and this warning:

 Assets/Scripts/$$anonymous$$isc/Joystick.cs(129,36): warning CS0109: The member `UnityEngine.UI.Joystick.OnValidate()' does not hide an inherited member. The new keyword is not required
avatar image Positive7 · Jul 27, 2015 at 11:23 PM 0
Share

OnValidate supposed to be called in Editor only afaik. By any chance you removed a part #if UNITY_EDITOR ... #endif

what is line 129 and 130?

avatar image shay4545 · Jul 27, 2015 at 11:30 PM 0
Share

129 is the protected override void and 130 is the one below.

2 Replies

· Add your reply
  • Sort: 
avatar image
11
Best Answer

Answer by Positive7 · Jul 27, 2015 at 11:28 PM

Replace it with :

 #if UNITY_EDITOR
 protected override void OnValidate()
 {
     base.OnValidate();
     UpdateJoystickGraphic();
 }
 #endif
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
avatar image
0

Answer by remembadaname · Feb 04, 2018 at 11:10 PM

I am getting a similar cs0115 error in this alt text

I cant remove the override either so i dont know what to do and the answer above looks the exact same as his problem...


screenshot-1.png (4.0 kB)
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

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

[Solved] Boolean is true and flase every frame 3 Answers

Error building Player: CommandInvokationFailure: Failed to build apk. See the Console for details () 1 Answer

Why won't unity remote 4 work for me? 0 Answers

Android build error unity 5.4 b15 0 Answers

Unity freezes on Packaging assest:sharedassets0.assest 2 Answers


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