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 'spawn'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • Example Projects
    • Scripts
    • Shaders
    • Unity Tutorials
    • FPS Kit Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • SELL | REQUEST
    • 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

Categories

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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 12 results

  1. I made a script (C#) and want that my gameobject spawns at a random position near the object (tree)(radius of maximal 3) that gets destroyed how can i doo this ? HERE is the Scipt: using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Treehealth : MonoBehaviour { public int health = 100; public GameObject logs; public GameObject conifer_tree; private void Update() { if (health <= 0) { Destroy(gameObject); Instantiate(logs, conifer_tree.transform.position, Quaternion.identity); Instantiate(logs, conifer_tree.transform.position, Quaternion.identity); Instantiate(logs, conifer_tree.transform.position, Quaternion.identity); Instantiate(logs, conifer_tree.transform.position, Quaternion.identity); Instantiate(logs, conifer_tree.transform.position, Quaternion.identity); } } } i saw a video but this was in javascript i hope anyone can help me
  2. This is a very inspector-configurable spawn system, which is executed in waves. Reduces additional programming to minimum if you are happy with features it comes with. Everything is randomly chosen and randomly spawned from current wave settings, so enemy spawning does not feel linear. You can: Set any amount of spawn points, and set/ change delay effect on it Set any amount of enemy types, set preferred spawn points for each of them, spawn ratio (per wave), and should that enemy be spawned from beginning or specific wave call Set specific events for specific waves, for example boss enemy/wave at wave 5 and 10 (in my example) You can set specific spawn points for specific enemies, so you could have specific enemies coming from certain areas (like flying, or wall crawling enemies) Certain spawn point can be locked and unlocked You can easily add any type of enemies via inspector, you could almost achieve same effect as in cod zombies in couple minutes Demo Move using AWSD, enemies are killed when you touch them. Play till level 10, so you would understand how it works. Spawn Manager script As it would be pretty confusing to set up, i am giving the whole project which shown in demo above. Download: Spawning.rar
  3. In this video I made "dot pooler" system to spawn in my dotes. Ps: The small mistakes are the worst! https://youtu.be/YHXw-peTzj4
  4. Hi everyone, I have trouble with my spawning system and I can't find a good way to get it to work. So basically in my game you should build a tower with blocks (cubes). And every time you place a new block a new block should spawn at a random spawn. So I worked hours on this and im really bad at scripting. This is what I have : This script is on the blocks: using UnityEngine; using System.Collections; using System.Collections.Generic; public class spawner : MonoBehaviour { public GameObject daspawn2; public bool working = false; public bool ok = false; public bool verloren2 = false; //public BoxCollider boxCol; void Update () { if (!GameObject.Find ("hand2").GetComponent<HandPhysicsController> ().IsHoldingObject2) { ok = true; } else { ok = false; } } void OnTriggerEnter(Collider other){ if(other.tag == "trigger") //if(ok == true) if(verloren2 == false) working = true; daspawn2.SetActive(true); } void OnTriggerExit(Collider other){ if (other.tag == "trigger") if(ok == true) verloren2 = true; } } This is on the base you build on: using UnityEngine; using System.Collections; using System.Collections.Generic; public class gamelogic : MonoBehaviour { private bool ok = false; public bool verloren = false; public Transform[] spawns; public int amountThings = 1; public int i = 0; public Transform[] Bone; void Update () { if (!GameObject.Find ("hand2").GetComponent<HandPhysicsController> ().IsHoldingObject2) { ok = true; } else { ok = false; } } void OnTriggerEnter(Collider other){ if(other.tag == "Block") if(ok == true) if(verloren == false) //activate when readyyyy Spawn(); } public void Spawn() { List<Transform> freeSpawnPoints = new List<Transform>(spawns); List<Transform> freeobjects = new List<Transform>(Bone); for (i = 0; i < amountThings; i++) { if (freeSpawnPoints.Count <=0) return; // Not enough spawn points int index = Random.Range(0, freeSpawnPoints.Count); int randomi = Random.Range(0,freeobjects.Count); Transform pos = freeSpawnPoints[index]; freeSpawnPoints.RemoveAt(index); // remove the spawnpoint from our temporary list freeobjects.RemoveAt(randomi); // remove the object from our temporary list Instantiate(Bone[randomi], pos.position, pos.rotation); } } void OnTriggerExit(Collider other){ if (other.tag == "Block") if(ok == true) verloren = true; } } and this is on a empty gameobject: using UnityEngine; using System.Collections; using System.Collections.Generic; public class spawn : MonoBehaviour { public GameObject daspawn; public bool gut = false; public Transform[] spawns; public int amountThings = 1; public int i = 0; public Transform[] Bone; void Update () { if (GameObject.Find ("Block").GetComponent<spawner> ().working) { gut = true; Spawn2(); } } public void Spawn2() { List<Transform> freeSpawnPoints = new List<Transform>(spawns); List<Transform> freeobjects = new List<Transform>(Bone); for (i = 0; i < amountThings; i++) { if (freeSpawnPoints.Count <=0) return; // Not enough spawn points int index = Random.Range(0, freeSpawnPoints.Count); int randomi = Random.Range(0,freeobjects.Count); Transform pos = freeSpawnPoints[index]; freeSpawnPoints.RemoveAt(index); // remove the spawnpoint from our temporary list freeobjects.RemoveAt(randomi); // remove the object from our temporary list Instantiate(Bone[randomi], pos.position, pos.rotation); daspawn.SetActive(false); } } } Now what working is you place a block on the base. Then a new block spawns at a random location. But if I place the new block on the other it only spawns a new one and then it does not spawn more. Its because I decativated the gameobject holding the spawner script. But I cant find a good way to actiate it again. Does someone have a good idea? Thanks for ever answer Here is a Screenshot of the block and components:
  5. Hello everyone! i just need a tiny bit of help. So i have a respawn script that works fine (Realistic FPS prefab item spawner) but the only problem is that for example i set the Item to respawn for 10 seconds but when i press play it spawns right away and when i pickup the object then it spawns 10 seconds later how do i fix the item from spawning when scene is played??? //Test script for repeated item spawning. using UnityEngine; using System.Collections; public class WeaponSpawn : MonoBehaviour { public GameObject gunPrefab; public float spawnTime = 30.0f; public GameObject gunInstance = null; private float timeLeft; void Start (){ timeLeft = 0; // You don't need to have weapons from the beginning } void Update (){ if(timeLeft > spawnTime || gunInstance){ timeLeft = spawnTime; }else if(timeLeft <= 0){ timeLeft = 0; Spawn(); } if(!gunInstance){ timeLeft-=Time.deltaTime; // Reduce the time counter } } void Spawn (){ // Make an instance of the weapon gunInstance = Instantiate(gunPrefab,transform.position,transform.rotation) as GameObject; timeLeft = spawnTime; // Reset the time needed to the normal amount of time } }
  6. Now I understand, that this could be extremely complicated but I wanted to know if anyone could help me with this: For my zombie survival game, i'm having a open world survival mode, and would like to know if anyone can give me a hint at how to spawn random types of zombies, all over the terrain. Kinda like: for example, zombies spawn at random locations all over the land? I get that this is probably hard, but if anyone can give me at lease a hint at someway to do this, much would be appreciated. Thanks!
  7. Hey guys, i'm working on a wave spawn script for the zombie kit, but i just can't really get it to work, I'm just in to scripting and learned all the basics, i have some pretty good scripts already,, but this one is just getting on my nerves. All i need in this script is when all the zombies are spawned, it restarts the process and multiply's the amount of zombies for the new wave. All the other stuff on the scrtipt can i do myself, but i just need some help with the spawning process. Oh and when anyone starts about the: Invoke(''function'', waitBetweenWaves) stuff, i already tried it, and didn't work. All help is appreaciated! var currentWave = 1; var spawn : boolean = true; private var CheckForEnemys : boolean = false; var waitBetweenWaves : int = 15; var spawnPoints : Transform[]; // Array of spawn points to be used. var enemyPrefabs : GameObject[]; // Array of different Enemies that are used. var amountEnemies = 20; // Total number of enemies to spawn. var multiplyEnemysPerWave = 1.2; var yieldTimeMin = 1; // Minimum amount of time before spawning enemies randomly. var yieldTimeMax = 3; // Don't exceed this amount of time between spawning enemies randomly. var enemiesToSpawnAtTheSameTime : int = 1; var startRoundSound : AudioClip; var endRoundSound : AudioClip; function Start(){ if (spawn){ StartNewWave(); } } function StartNewWave(){ StartCoroutine("Spawn", waitBetweenWaves); } function Spawn(){ if(amountEnemies > 0){ yield WaitForSeconds(Random.Range(yieldTimeMin, yieldTimeMax)); // How long to wait before another enemy is instantiated. for(var s : int = 0; s < enemiesToSpawnAtTheSameTime; s++){ var obj : GameObject = enemyPrefabs[Random.Range(0, enemyPrefabs.length)]; // Randomize the different enemies to instantiate. var pos: Transform = spawnPoints[Random.Range(0, spawnPoints.length)]; // Randomize the spawnPoints to instantiate enemy at next. Instantiate(obj, pos.position, pos.rotation); CheckForEnemys = true; } amountEnemies --; } } function Update(){ var enemies = GameObject.FindWithTag("Enemy"); if (CheckForEnemys){ if (enemies == null){ StartNewWave(); amountEnemies = Mathf.RoundToInt(amountEnemies * multiplyEnemysPerWave); audio.PlayOneShot(endRoundSound); CheckForEnemys = false; } } }
  8. When I start the game, either two instances or get a different computer, I host a game and join on the other. Now the lobby says theres two people in the game and what not, but nobody is really there? Different waves and what not? Is there a way to fix that? So other players will actually be in the same game? Thanks to anyone who helps. Here's a build if you wanna test the problem yourself. https://www.mediafire.com/?gycfsl2da99ssvw
  9. Hi guys , im asking you for a script who spawn random objects ( for loot ) a script where you can add spawnpoint but do not spawn many objects or 1 object all time , i want it to spawn randomly . so who can help me post bellow or PM me and thnx .
  10. PauloJunior

    Spawn System

    Hello guys, Finished version 0.1a With all the languages ​​mentioned in the last post. Spawn Distance Spawn Random Interfaces Portugueses/English/Russian and Chinese: Download Version 0.1a: Spawn_V0.1a.rar Spawn_V0.1a.rar
  11. Hello, everyone In a tiny game I'm working on a have a bike and here's my problem: (Use action is assigned to "E" keyboard key, I can get on/get off bike by pressing it.) I walk up to bike press "E" and start driving to my destination. When I reach it I press "E" key again but I'm spawned right where I started my ride (bike stays at my destination). And my question is how can I spawn my player where I get off my bike? Any answers much appreciated. Thank you!
  12. Version 0.1a

    372 downloads

    Two Modes: Mode Random Mode Distance
×
×
  • Create New...