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



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

  1. In this video I make a color changing system and a size changing system for our dots / points / balls / how ever you wanna call them https://www.youtube.com/watch?v=fq44gUEsCII
  2. Here is a free autodesk page where you can generate a free character and customize it!! You only need an autodesk acount. Click here --> charactergenerator.autodesk.com
  3. 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:
  4. Hi everyone, i have a problem with a script that should play sounds in a random order. But I cant hear anything when I test it. This is the script: var sounds: AudioClip[]; function PlayRandom(){ if (audio.isPlaying) return; audio.clip = sounds[Random.Range(0,sounds.length)]; audio.Play(); } I attached the script to a empty gameobject and addet the sounds and a audio source to the object. Does anyone know how to fix this? (my player has a audio listener) thanks
  5. 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!
  6. Hey guys, I was wondering if anyone had a AWESOME name for a Game Company, not that i have one, but i'm just looking for awesome names, followed by: ''games'', for example a weird and funny one: ''SewerHooker Games'', i don't care how weird or crazythe name is, because i am weird and crazy hahaha, so tear open your mind for one minute, and please post EVERYTHING bellow! THANKS!
  7. Hey Guys I started to make a funny Script that is creating Cube Prefabs Randomly. Only add this Script to an Empty Gameobject or something else and set up the Prefabs which should Spawn. It is very funny if you add those Prefabs Rigidbodys! . Here is the Video: http://www.youtube.com/watch?v=StW0PKbdljk Hope you like it heres the Script: //Add this Variables to whatever you want? var GrassBlock:GameObject; var DirtBlock:GameObject; var GlassBlock:GameObject; var WoodPlankBlock:GameObject; function Start () { } function Update () { var BlockNumber:int = UnityEngine.Random.Range(0,5); if(BlockNumber == 1){ //yield WaitForSeconds(1); var Block1:GameObject = Instantiate(GrassBlock, transform.position, transform.rotation); } if(BlockNumber == 2){ //yield WaitForSeconds(1); var Block2:GameObject =Instantiate(DirtBlock, transform.position, transform.rotation); } if(BlockNumber == 3){ //yield WaitForSeconds(1); var Block3:GameObject =Instantiate(GlassBlock, transform.position, transform.rotation); } if(BlockNumber == 4){ //yield WaitForSeconds(1); var Block4:GameObject =Instantiate(WoodPlankBlock, transform.position, transform.rotation); } }
×
×
  • Create New...