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 Doneyes · Aug 15, 2012 at 12:13 AM · booleanparticle

Why will this particle not play?

The particle is supposed to play when Bleeding = true and stop when it equals false. Anyone see an error? I feel like there may be some kind of loop or something making it collide and messing it up.

 var Blood : GameObject;
 var SystemHealth : GameObject;
 var OrigHealth : float = 300; //Make sure this variable gets subtracted at the same rate as Health.
 var Health : float = 300;
 var RobotHealth : float = 800;
 var BloodCheck : boolean = false;
 var LimbCheck : boolean = false;
 var Prop : GameObject;
 var PropDestination : GameObject;
 var Robot1 : GameObject;
 var Robot2 : GameObject;
 var Robot3 : GameObject;
 var Robot4 : GameObject;
 
 
 function Start ()
 {
 Blood.GetComponent(ParticleSystem).Stop();
 }
 
 function Update ()
 {
     if(BodyArmature.GetComponent(LimbHealth).Health <= 0 && LimbCheck == false)
     {
         LimbBroke = true;
         LimbCheck = true;
         BodyMesh.renderer.enabled = false;
  
         SystemHealth.GetComponent(MainPlayerHealth).MaxHealth -= Health;
         Bleeding = true;
         Prop.transform.parent = PropDestination.transform;
         Prop.renderer.enabled = true;
         Prop.rigidbody.isKinematic = false;
         Prop.rigidbody.mass = 1;
         Prop.GetComponent(BoxCollider).enabled = true;
     }
 
     if(BodyArmature.GetComponent(LimbHealth).Health >= 100 && LimbCheck == true)
     {
         LimbBroke = false;
         LimbCheck = false;
         BodyMesh.renderer.enabled = true; 
         
         SystemHealth.GetComponent(MainPlayerHealth).MaxHealth += Health;
         Bleeding = false;
         Prop.renderer.enabled = false;
         Prop.rigidbody.isKinematic = true;
         Prop.rigidbody.mass = 0.0001;
         Prop.GetComponent(BoxCollider).enabled = false;
     }
     
     if(BloodCheck == true) {
     //FixedUpdate();
     BloodCheck = false;
     }
     
     if(BloodCheck == false) {
     //FixedUpdate();
     BloodCheck = true;
     }
     
     if(RobotCheck == true) {
     
     Robot1.renderer.enabled = true;
     Robot2.renderer.enabled = true;
     Robot3.renderer.enabled = true;
     Robot4.renderer.enabled = true;
     
     BodyMesh.renderer.enabled = false;
     Bleeding = false;
     
     Health = RobotHealth;
     
     BodyMesh.renderer.enabled = false;
     }
     
         if(RobotCheck == false && LimbBroke == false) {
     
     Robot1.renderer.enabled = false;
     Robot2.renderer.enabled = false;
     Robot3.renderer.enabled = false;
     Robot4.renderer.enabled = false;
     BodyMesh.renderer.enabled = true;
     Health = OrigHealth;
     
     }
     
     if(RobotCheck == false && LimbBroke == true) {
     
     Robot1.renderer.enabled = false;
     Robot2.renderer.enabled = false;
     Robot3.renderer.enabled = false;
     Robot4.renderer.enabled = false;
     
     BodyMesh.renderer.enabled = false;
     Bleeding = true;
     Health = OrigHealth;
     }
     
     if(Bleeding == false) {
     Blood.GetComponent(ParticleSystem).Stop();
     }
     
     if(Bleeding == true) {
     Blood.GetComponent(ParticleSystem).Play();
     }
 }
 
 function FixedUpdate() {
 
  if(Bleeding == true) {
     SystemHealth.GetComponent(MainPlayerHealth).MaxHealth -= BloodLoss;
     yield WaitForSeconds(5);
     }
 }
Comment
Add comment · Show 1
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 Ben-Stoneman ♦♦ · Jan 03, 2013 at 04:52 PM 0
Share

You have commented out fixed update?

if(BloodCheck == false) { //FixedUpdate(); BloodCheck = true; }

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

8 People are following this question.

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

Related Questions

This boolean is messing up. Help? 1 Answer

Particle collider not working 0 Answers

Is there OnParticleCollisionExit()? If none how to make. 2 Answers

How do you make a Particle System of weather effect look believable when parented to player camera? 0 Answers

Waiting for a Function to Complete 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