Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by CanneyDraws · Feb 11, 2013 at 04:57 PM · bce0017

BCE0017 trouble with TWBS Tutorial

Hi all, I'm a complete noob, be gentle.

I've been using the Walker Brothers unity tutorial. So far I'm getting the basics of JavaScript/UnityScript down. I've managed to work out most issues I have ran into, but in this instance, this simple script is throwing up an error when I'm trying to use an overload method (correct me if I am wrong in my terminology).

The script is as follows:

 function Update () 
 {

     Donkey=Person("Donkey");
     Horse=Person("Horse");
     Donkey.TeamUp("Horse");
 
 }
     class Person
     {
         var name;
         function Person(n:String)    //constructor
         {
             name = n;
         }
         function TeamUp(p:Person)
         {
                 print(name+" teamed up with " + p.name+"!");
         }
     }

Error reads as:

Assets/scripting_basics_1.js(332,21): BCE0017: The best overload for the method 'Person.TeamUp(Person)' is not compatible with the argument list '(String)'.

As far as I can tell, everything is correct as far as the Tutorial suggests, obviously there is something not formatted correctly. If someone could kindly share the correct method of pairing up Donkey and Horse via print and offer an explanation as to why I got this error. Any help is much appreciated. Thank you in advance.

Comment
Add comment
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

2 Replies

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

Answer by Dave-Carlile · Feb 11, 2013 at 05:19 PM

The TeamUp function requires a parameter of type Person. You're passing in a string. You want to pass in the actual object instance Horse, like so:

 Donkey.TeamUp(Horse);

Note there are no quotes there - you want to pass in the variable Horse, not the string "Horse".

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 CanneyDraws · Feb 11, 2013 at 05:58 PM

Ah, I had been staring at my code vs the example code too long and overlooked my inclusion of the quotes. Thank you Dave, I now have a better understanding and wouldn't have realised without your intervention.

  • this man.

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

10 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

Related Questions

GameObejct.Find using string variable for name 1 Answer

MouseLookPlus Script- can't access certain variables in the inspector view 1 Answer

Pro image effect error? 0 Answers

The best overload for the method 'UnityEngine.Object.FindObjectOfType(System.Type)' is not compatible with the argument list '(s_mainCharacter)'. 1 Answer

Rotate and eulerAngles don't work together ?? 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