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 /
  • Help Room /
avatar image
0
Question by Flairsus · May 28, 2017 at 03:15 PM · zombiespawner

ZombieSpawner help

Hello everyone, my script don't work, The zombie are spawing with a delay of 1 seconds when i'm on 0 zombietue and the ROUND is all time at 13 i don't understand why because the variable zombietue work right

pragma strict

ar ZombieHealth : int = 100; var die : int = 1; var ammo : int = 3; private var zombietue : Zombiespawner; private var shoteject : ShotEject; function Start () { zombietue = GameObject.Find("Spawn").GetComponent(Zombiespawner); shoteject = GameObject.Find("Eject").GetComponent(ShotEject); }

function OnCollisionEnter (col : Collision) { if (col.gameObject.tag =="Bullet") { ZombieHealth -=34; }

}

function Update () { if(ZombieHealth <= 0) { GetComponent.().Play("back_fall"); gameObject.GetComponent(ZombieAI).enabled = false; gameObject.GetComponent(CharacterController).enabled = false; gameObject.GetComponent(CapsuleCollider).enabled = false; gameObject.GetComponent(BoxCollider).enabled = false; Dead();

 }

}

function Dead()

{

 yield WaitForSeconds (2);
 zombietue.Zombietue += 1;
 shoteject.reserve += ammo;
 Destroy (gameObject);    
 

}

pragma strict

ar object : Transform; var wait : int = 15; var Zombietue : int = 0; var Round : int = 1; function Start () { True(); Modificateur();
}

function True () { while (true){ Spawn(); Modificateur(); yield WaitForSeconds(wait); }

} function Spawn(){ Instantiate (object,Vector3(200,0,302),Quaternion.identity); Instantiate (object,Vector3(85,0,383),Quaternion.identity); Instantiate (object,Vector3(85,0,386),Quaternion.identity); Instantiate (object,Vector3(303,0,118),Quaternion.identity); Instantiate (object,Vector3(373,0,188),Quaternion.identity); Instantiate (object,Vector3(292,0,276),Quaternion.identity); Instantiate (object,Vector3(-21,0,-159),Quaternion.identity); Instantiate (object,Vector3(359,0,185),Quaternion.identity); Instantiate (object,Vector3(305,0,254),Quaternion.identity); Instantiate (object,Vector3(236,0,232),Quaternion.identity); Instantiate (object,Vector3(186,0,232),Quaternion.identity); Instantiate (object,Vector3(173,0,144),Quaternion.identity); Instantiate (object,Vector3(256,0,96),Quaternion.identity); Instantiate (object,Vector3(373,0,117),Quaternion.identity); Instantiate (object,Vector3(338,0,178),Quaternion.identity); Instantiate (object,Vector3(327,0,236),Quaternion.identity); Instantiate (object,Vector3(275,0,278),Quaternion.identity); Instantiate (object,Vector3(125,0,117),Quaternion.identity);

} function Modificateur (){ if (Zombietue < 10); { wait = 15; Round = 1; } if (Zombietue > 10); { wait = 14; Round = 2; } if (Zombietue > 20); { wait = 13; Round = 3; } if (Zombietue > 30); { wait = 12; Round = 4; } if (Zombietue > 40); { wait = 11; Round = 5; } if (Zombietue > 50); { wait = 10; Round = 6; } if (Zombietue > 60); { wait = 9; Round = 7; } if (Zombietue > 70); { wait = 8; Round = 8; } if (Zombietue > 80); { wait = 7; Round = 9; } if (Zombietue > 90); { wait = 6; Round = 10; } if (Zombietue > 100); { wait = 5; Round = 11; } if (Zombietue > 200); { wait = 3; Round = 12;; } if (Zombietue > 1000); { wait = 1; Round = 13;; } } function OnGUI() { GUI.Box(Rect(10,80,110,20), "Zombietué : " + Zombietue); GUI.Box(Rect(80,10,110,20), " ROUND : " + Round); }

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 nathanlink169 · May 28, 2017 at 07:32 PM 0
Share

Please format your code correctly for the site, it's impossible to read this, and therefor impossible to help.

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

104 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 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 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 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 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 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

NullReferenceExeption 0 Answers

random spawn points per round 0 Answers

I can't get my spawner to work! pls help fast. 0 Answers

Unity5 Collider error 0 Answers

Why wont this script network to client? 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