Quantcast
Channel: Questions in topic: "random spawn"
Browsing latest articles
Browse All 125 View Live

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 Article



Ecosystem 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 Article

Instantiate 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 Article

random 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 Article

i 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 Article


Random 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 Article

Random 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 Article

Random 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 Article


Random 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 Article


Multiple 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 Article

How 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 Article

Random 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 Article

2d 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 Article


spawn 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 Article

Random 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 Article


How 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 Article

Problem 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 Article


Randomly 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 Article

Damn 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 Article

Spawning 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 Article

Enemy 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 Article


Spawn 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 Article


Instantiate 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 Article

Random 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 Article

Hello. 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 Article


Spawning 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 Article

How 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 Article

Spawn 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 Article

Counter 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 Article



How 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
Browsing latest articles
Browse All 125 View Live




Latest Images