• 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 Pivot12 · Feb 11, 2013 at 02:33 AM · javascripterrorspawnerspawn points

"MissingMethodException: Method not found:" (Javascript)

I am trying to make a button activated spawn point using "Spawner - Free 1.7" and I am having trouble. I am modifying the code of a lift button already implemented in my scene.

 var Spawner : GameObject;
 var UseSound : AudioClip;  
 private var canUse : boolean = false;
 var waitTime : float; //Time till Spawner activate
 private var IRuzspiests : boolean = false;
 var SpawnerID : float;
 
 
 function Activate () {
     Spawner.EnableSpawner(int.SpawnerID);
     audio.PlayOneShot(UseSound, 1.0 / audio.volume);
 }
 
 function Deactivate (){
     Spawner.DisableSpawner(int.SpawnerID);
     audio.PlayOneShot(UseSound, 1.0 / audio.volume);
 }
 
 function ApplyDamage(){
     Action ();
 }
 
 function Action (){
     if (!canUse && !IRuzspiests){
         Activate();
         canUse = true;
         IRuzspiests = true;
         yield WaitForSeconds(waitTime);
         IRuzspiests = false;
     
     }else{
         if (canUse && !IRuzspiests){
         Deactivate();
         canUse = false;
         IRuzspiests = true;
         yield WaitForSeconds(waitTime);
         IRuzspiests = false;
         }
     }
 }

and here is the error

 MissingMethodException: Method not found: 'UnityEngine.GameObject.EnableSpawner'.
 Boo.Lang.Runtime.DynamicDispatc$$anonymous$$ng.MethodDispatcherFactory.ProduceExtensionDispatcher ()
 Boo.Lang.Runtime.DynamicDispatc$$anonymous$$ng.MethodDispatcherFactory.Create ()
 Boo.Lang.Runtime.RuntimeServices.DoCreateMethodDispatcher (System.Object target, System.Type targetType, System.String name, System.Object[] args)
 Boo.Lang.Runtime.RuntimeServices.CreateMethodDispatcher (System.Object target, System.String name, System.Object[] args)
 Boo.Lang.Runtime.RuntimeServices+<Invoke>c__AnonStorey14.<>m__7 ()
 Boo.Lang.Runtime.DynamicDispatc$$anonymous$$ng.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatc$$anonymous$$ng.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatc$$anonymous$$ng.DispatcherFactory factory)
 Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatc$$anonymous$$ng.DispatcherFactory factory)
 Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatc$$anonymous$$ng.DispatcherFactory factory)
 Boo.Lang.Runtime.RuntimeServices.Invoke (System.Object target, System.String name, System.Object[] args)
 UnityScript.Lang.UnityRuntimeServices.Invoke (System.Object target, System.String name, System.Object[] args, System.Type scriptBaseType)
 SpawnTriggerScript.Activate () (at Assets/Resources/OldScripts/LiftScripts/SpawnTriggerScript.js:11)
 SpawnTriggerScript+$Action$404+$.MoveNext () (at Assets/Resources/OldScripts/LiftScripts/SpawnTriggerScript.js:26)
 UnityEngine.GameObject:BroadcastMessage(String)
 FPSCcameraScript:Update() (at Assets/Resources/OldScripts/Ve$$anonymous$$cle scripts/FPSCcameraScript.js:18)
 

If anyone could tell me what I need to do to get t$$anonymous$$s to work, it would be much appreciated.

the documentation on how to use the spawner is here: https://dl.dropbox.com/u/43996324/Unity/Spawner/html/functions.html

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by flaviusxvii · Feb 11, 2013 at 03:46 AM

Firstly, "Spawner" is the name of a Class in t$$anonymous$$s "Spawner" package. So you don't want to name a variable "Spawner". In fact, you just shouldn't name your variables with upper case letters at the beginning, it's almost universally the norm to name TYPES with upper case letters to start.

Secondly, Your variable "Spawner" is of type GameObject. GameObject doesn't not have a method called EnableSpawner. If you want to treat "Spawner" like some other type, then the variable will need to be that type. You should change

 var Spawner : GameObject;

to

 var spawner : Spawner;

Then you can call spawner.EnableSpawner all day long.

Comment
Add comment · Show 6 · 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 Pivot12 · Feb 11, 2013 at 03:56 AM 0
Share
avatar image flaviusxvii · Feb 11, 2013 at 05:24 AM 0
Share
avatar image Pivot12 · Feb 11, 2013 at 10:42 PM 0
Share
avatar image flaviusxvii · Feb 12, 2013 at 03:26 AM 0
Share
avatar image Pivot12 · Feb 12, 2013 at 03:55 AM 0
Share
Show more comments

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

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

Can someone help me fix my Javascript for Flickering Light? 6 Answers

Setting Scroll View Width GUILayout 1 Answer

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

null exception reference on animation Unity 3.5+ 2 Answers

Trying to get enemy to aim at the player and shoot at it 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