How to spawn objects in a given area ?
I want to spawn objects on a road but at some point my road have to ways ... how to spawn on that road ? For example i'm on C road and it splits in two : A_road and B_road if i take A_road ..how to get...
View ArticleEcosystem generator script generating everything in the same place
Hello, it seems that my ecosystem generator script is "randomly" spawning all of the game objects in about three different places, even though the coordinates are "randomized" every time an object is...
View ArticleInstantiate a minimum of gameObject (instantiate un nombre minimum de...
hi everybody, i'm a begginer and i tried to spawn item at random spots. but i need to spawn a minimum of gameObject, like 7. actually, it spawns a random number of gameObject. here is my code to spawn...
View Articlerandom swap the block (block will have color)
![alt text][1] [1]: /storage/temp/108310-block.png I have 5 blocks in my 2d game and a player(blue color) i want random(only four color) color in my 5 blocks at one time when spawned (color must be...
View Articlei want random color in my five block but not same color how i do that
i want random colour in my fuve block but not same colour how i do that and i want to compare that color with my player if color is same(player and block) then it will go if not then gameover![alt...
View ArticleRandom Map generation like Temple run,Random Map generation like Temple Run.
Hello Guys, I am currently working on a 3d endless runner game and I am stuck at random generation of track. I am able to generate straight tracks like subway surfers, but i am not able to create...
View ArticleRandom Item Appear (JavaScript), 아이템 랜덤 등장 (자바스크립트)
**I want to write JavaScript to make the items(3D Object=cube) appear randomly. (The section is fixed but the location is random)** If this is a problem you can solve, please help me. I am sorry that...
View ArticleRandom Object Spawning
Hello im trying to spawn two Objects but i get a error "NullReferenceException: Object reference not set to an instance of an object" I know what that means but i cant find my error. The error marks me...
View ArticleRandom bitmap generator
Hi! I've been pouring through these posts, but I haven't found anything that could really point me in the right direction. I just want to preface this by saying that I'm a complete beginner when it...
View ArticleMultiple spawn location with random game object in random time spawn c#
I have this codes but when I run, sometimes the gameobjects spawn at the same time and at the same place. I need help. public Transform player; public float maxTime; public float minTime; public int...
View ArticleHow to use a randomobject script on walls?
I want to randomly place a poster I made on the walls in my game. My teacher showed me a randomobject script, but it just places the selected model randomly throughout the Terrain. How could I edit...
View ArticleRandom Respawn,Random Spawn
Currently, I'm making a shooting game. I want to respawn enemies randomly. This is the code i've made: using System.Collections; using System.Collections.Generic; using UnityEngine; public class...
View Article2d game for different screen resolutions
I want to develop a 2d game for mobiles. The concept will be like, the bubbles will be created at a random position and moves till top of the screen. Below are my questions. 1. How to get a...
View Articlespawn random object and move it
I need help with scripting on how to spawn a cube at a random position (In 3d) .. say its a falling object. And how could you make this as efficient as possible?? :D
View ArticleRandom Generation problem GameObject
I have a problem how to set a Random object in a polygon without placing it on another object in that polygon Code is: public float XSize = 8.7f; public float ZSize = 8.7f; public GameObject...
View ArticleHow to Detect if a Collider is in the Area, Move Away, Rinse and Repeat?
Hello, everyone. In my 2D game, since I couldn't figure out how to prevent them from originally spawning on top of each other, a few random platforms are generated within a certain area by an empty...
View ArticleProblem with instantiating the object in untiy at certain time intervals
Hello Community I'm a complete beginner in untiy and trying to figure spawn objects randomly at fixed time intervals (every 1 or 2 seconds).. But the issue I'm facing in my script is that the random...
View ArticleRandomly generated interior in the Pacman-clone game
Hi! I am facing a quite problematic issue here. What I want to achive is to spawn random objects (from 12 builded prefabs) in the random places - but the place itself cannot be totally random - it has...
View ArticleDamn Compiler Errors, pls help me
Greetings Fellow Developers, I'm constructing a Game for a Project which requires me to spawn in random blocks (or Prefabs to use technical terms) on the end of the map so they spawn a random Block...
View ArticleSpawning a specific Tile in a random position a certain distance from the...
So i'm making a 2D game and I am using a Tilemap. I want to spawn a specific Tile at a random location on the Tilemap, but it has to be 6 tiles away from the player characters Tile position (the player...
View ArticleEnemy spawn logic not working
I am making a top down 2D game. I have 12 predefined spawn points for enemies, represented by a sprite on screen. on this sprite I have the following script. using System.Collections; using System;...
View ArticleSpawn in one given position randomly
Hey guys, I need help. I have three spawnpoints, each one in an different room and I have an object. I want the object to spawn in one of the three spawn points randomly each time I start the game but...
View ArticleInstantiate objects in given range
I am trying to Instantiate objects on the right and the left side of the player but not in front of it. ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ So let's assume the player's...
View ArticleRandom X position 2D
I was trying to make an object move to a random X position. But when I run the code the object just stays in the same position. public class RandomSpawn : MonoBehaviour { Rigidbody2D body; float Y =...
View ArticleHello. How to make random items on map?
Hey. I am creating location-based game like Pokemon GO. And as I said in topic I want to make random items spawning on the map (but SCPs will be here instead of pokemons). Thanks for any kind of help.
View ArticleSpawning prefabs randomly on top of existing tiles
Good day everyone! I'm currently in the process of building a 2D Game, and as for my next step I'd like to randomly spawn collectable gems (prefabs) on top of my tiles for the player to collect. My...
View ArticleHow can I randomise location of objects in a room?
Hi guys. What Im trying to do in the room I've created for the game is to have a desk randomly located in different locations in the room but to also have objects that may go inside or on top of the...
View ArticleSpawn prefab randomly over polygon collider 2d
I have attached pollygon collider 2d on this gameObject. ![alt text][1] This gameObject is parent of another gameObject (just small circle). **I want that small circle to randomly spawn somwhere on...
View ArticleCounter is increased according to the amount target while i only clicked 1...
So i was making an Aimlab mockup and made a counter variable to store how much target i clicked in the span of time i had. The game is pretty much done, so when i clicked one of the target it will move...
View ArticleHow to spawn a prefab randomly only once
I'm working on a small game, where the player has to find their home. Ideally the house would spawn at a new location every time the game is played. I am new to coding so I'm not sure if what I have...
View Article