Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

Search the Community

Showing results for tags 'waitforseconds'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase


  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files


  • Community Calendar

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL





YouTube URL

Facebook URL

Twitter URL

IndieGoGo URL

Kickstarter URL


GreenLight URL



Found 3 results

  1. Hi everyone, I have a script that play randomly audio and now i want a delay after every sound. I tried using waitforseconds function but i cant get it to work. this is the script: var sounds: AudioClip[]; InvokeRepeating("PlayRandom", 0, 1); function PlayRandom(){ if (audio.isPlaying) return; audio.clip = sounds[Random.Range(0,sounds.length)]; audio.Play(); } Thanks
  2. Hello all.. I'm messing around with a third Person shooter.. But when my weapon reloads its instant.. So i was hoping to put a "WaitForSeconds" in the reload function but since its C# I'm really not sure how to execute it. This is the reload part. private void Reload() { Debug.Log("Reload [" + weaponsSet[weaponIndex].weaponName+"]"); int needBullets = (weaponsSet[weaponIndex].clipSize - weaponsSet[weaponIndex].currentBulletsCount); if (weaponsSet[weaponIndex].haveBullets >= needBullets){ weaponsSet[weaponIndex].haveBullets -= needBullets; weaponsSet[weaponIndex].currentBulletsCount = weaponsSet[weaponIndex].clipSize; } else{ weaponsSet[weaponIndex].currentBulletsCount = weaponsSet[weaponIndex].haveBullets; weaponsSet[weaponIndex].haveBullets = 0; } } I have a variable public float reloadTime; I did some searching and found this. yield return new WaitForSeconds(reloadTime); but this throws a error The body of `WeaponController.Reload()' cannot be an iterator block because `void' is not an iterator interface type Also, If i replace Void Reload() with IEnumerator Reload() I get even more errors.. So im unsure what to do Hopefully someone can help me out.. if you need more info let me know
  3. Hey guys, it's me again. So, I'm currently in Spain and enjoying vacation. But there is one thing you can enjoy more, programming while having a vacation! So what I did is that I brought my laptop to Spain and installed unity and transfered my game. Now, when I'm about to script and intro (or anything to do with Yield), well... It will not run the code. Example, I write yield WaitForSeconds (3); and then write another line of code, it doesn't simple continue... I've tried opening and creating another project but no darn luck help please? Thanks, your fellow friend, Joseph!
  • Create New...