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 /
avatar image
1
Question by entrapped89 · Sep 20, 2011 at 04:10 AM · prefabclone

Problems with cloned prefabs

Hello :)

I have some problems with the interaction of/between cloned objects.. When I destroy my enemy prefab it instantiates a clone or some clones (Random.Range) of the magicOrb prefab.

I've been trying to get these orbs to interact with my character, but somehow I can't get them to interact :( I can't drag'n'drop my player object in the inspector of my prefab, the orb prefab can't find my "find object with tag" for some strange reason, and even if I turn the system around and let the script attached to my player character interact with the GameObject magicOrb they simply won't work :(

Is it a common problem/bug with Unity 3?

BTW I have a really strange error every time the debugger pops up:

" classID >= ms_MaxClassID || classID < 0 "

Shows as an error, but it builds and plays just like normal.

Could this have anything to do with it?

Thanks in advance :)

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 kevork · Sep 20, 2011 at 05:03 AM 0
Share

GameObject.FindGameObjectsWithTag works just fine in Unity 3, so the problem is likely that the problem is either you are looking for the wrong tag or the tag is not on the "Player" object.

What error are you getting?

avatar image timsk · Sep 20, 2011 at 08:14 AM 0
Share

Would be helpful if you could post your "interact with the orb" script and also, what error you are getting on that script. Im not sure on the classID error, never had that myself.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by entrapped89 · Sep 20, 2011 at 02:08 PM

Thanks for replying :)

My AddMagicPointsScript:

 var magicPointsAdd : int = 10;

function Awake () { var player = GameObject.FindWithTag("Player"); }

function OnTriggerEnter (player : Collider) {
var myScript : MagicScript = FindObjectOfType(MagicScript); myScript.magicCount += magicPointsAdd; Debug.Log ("You have the item!"); Destroy (gameObject, 1); }

I attached the script to the "triggerzone" trigger object. Even when I copy an instance of the object in the editor it does not work..

Somehow the moment the object (or it's clones) touches the terrain mesh the script triggers the effect! I'm 100% sure I have added the Player tag to my FPS controller..

I'm at a loss :P

What am I doing wrong?

Thanks in advance :)

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 entrapped89 · Sep 20, 2011 at 02:10 PM 0
Share

O$$anonymous$$G :P I added this text as an answer.. I'm not that good at blogging.. :P sorry moderators :P

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Cloned Prefab 3 Answers

Instatiating an object. Altering that new object causes prefab to be altered. 2 Answers

Instantiated Object turning off scripts and audio source?(Solved) 1 Answer

OnTriggerEnter2D not working on sprite's prefab clones 0 Answers

How to destroy a clone (instantiate in scene) in the their own script 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