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 mattlewis83 · Jul 07, 2013 at 07:30 PM · spawnpathparticle

particle spawn issue.

 //Use the 10101011 button to format your code.
 
 
 var particles : ParticleEmitter;
  
 function OnTriggerEnter (other : Collider)
 {
     if(other.gameObject.FindWithTag("Respawn"))
     { 
         particles.emit = true;   
     } 
     else
     {
         particles.emit = false;
     }
 }

i have this script attatched to a poker. when the poker collides with "Respawn" which is my enemy characters... it emits a red shower of particles.(blood) the problem is... i have a few characters on screen and if you hit any one of them... only the original character that i duplicated emits the blood. if i hit the other ones nothing comes out despite all of the characters being an exact copy of one another. can someone explain why or supply an elegant solution?

Comment
Add comment · Show 9
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 Bunnybomb7670 · Jul 07, 2013 at 08:53 PM 0
Share

i think its to do with the fact that findwithtag finds the first one only, i think your going to have to have an integer of the enemies in the scene and then do a for loop and check through them, i really suggest that you store the GameObject's in an array so that you can access them easier and control them a lot easier.

avatar image mattlewis83 · Jul 08, 2013 at 03:46 AM 0
Share

how do i create an array and assign an integer for the for loop to check through them? i'm new to this and am really anxious to learn.

avatar image ebogguess · Jul 08, 2013 at 03:53 AM 0
Share

You'll have to search for javascript array and do some research on your language of choice (javascript or C#).

avatar image Quillicit · Jul 08, 2013 at 04:01 AM 0
Share

Try switching it around so the script is on the respawn (and modify the code accordingly). Then you don't have to differentiate between them.

avatar image mattlewis83 · Jul 09, 2013 at 08:45 PM 0
Share

thanks for the response. i will do. i almost had it yesterday. so i tried a different method. ins$$anonymous$$d i just instantiated the particle much like a bullet from a gun. i created a spawn point on the character and then did a on collision enter. the thing is it still just squirts out in spurts constantly. i dont know how to make it just play on trigger. hmmm.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

18 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

Related Questions

Help on a Power-Up Sequence 1 Answer

Spawning the character with camera behind it on load using c# 1 Answer

How can i loop my path instead of it ending on the lasat point 1 Answer

Spawn System Troubles 0 Answers

Waypoint Setup: How? 4 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