Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [spawning]

The tag has no usage guidance.

0
votes
0answers
13 views

Unity C# Help With Distance Based Spawner

I am having issues creating a spawn system that relies on the distance of the last object spawned from the spawnpoint. I do not want to use a timer to determine when the next object is spawned but ...
3
votes
1answer
55 views

Instantiate object with spawn time?

I have script that makes waves of enemies. It selects enemy from array randomly. I want to add function allow me to select any object in my array and instantiating it for number of times. In wave 1, ...
0
votes
1answer
37 views

Rotate object to closest clone?

I'm working on a tower defense game. I'm trying to make my gun object rotate and shoot the nearest instance of the "enemy" object. My problem here is my gun script rotates only to the main enemy ...
0
votes
1answer
147 views

How do open world games handle efficiently enemy respawn?

I'm currently working on a 2D open world game loaded in chunks, initially I thought It would be sufficient to spawn entities randomly in a specific "radius" close to the player, and periodically ...
0
votes
2answers
195 views

How do I respawn a prefab that matches the name of the game object I just destroyed?

In my game the player can interact with certain objects like coins, clouds and springs. After these interactions the game objects are destroyed. All of these game objects have their own properties, ...
2
votes
1answer
398 views

Unity: Player Gets Stuck Between Tiles

I am creating an endless game, which constantly spawns tiles. The problem is that after a few tiles the player gets stuck on random tile and stops moving. I noticed this problem even when i was ...
1
vote
4answers
584 views

How can I spawn items based on probabilities?

I'm working on a game where I want to choose which object to spawn based on probabilities. Assuming the decision to spawn the object has been done by some other process, I'd like the object with the ...
-3
votes
1answer
256 views

Game maker studio 2 Random spawn locations are not random [duplicate]

This is a redo of another question I asked. First I want to clarify that I am indeed using drag and drop. So saying something like "maybe switching to gml will fix your problem" is appreciated, but ...
-1
votes
1answer
157 views

How to limit where an object spawns GameMaker Studio 2

So I am trying to, when the game starts, generate an object in a random area. It's working, but sometimes the object spawns in the players view. Does anybody know how to have an object that generates ...
3
votes
1answer
854 views

Why does UE crash when I spawn a tile actor like this?

I'm trying to replicate a version of "Paper.io" using Unreal Engine and C++ as an exercise. My idea is to have an instance of an Actor (that is my "Grid class" in this case), and another Actor acting ...
0
votes
1answer
84 views

Make enemy disappear after spawn

I have enemies that spawn in different positions but what I want to do is that if you don't kill it after three seconds, the enemy disappears (but the spawning keeps happening of course, the enemy ...
0
votes
1answer
128 views

Animation after enemy spawns

right now in my game, four enemies spawn in four spawn points with a delay, but what I want to do is that if you don't kill the enemy after a couple seconds, an animation (it's an animation of a ...
1
vote
2answers
71 views

Display image a couple seconds after an enemy spawns?

So right now I have enemies that spawn behind objects with a delay. What I need is to display an image on the screen 5 seconds after each enemy spawns (it's to show the player it has been "attacked")...
1
vote
1answer
50 views

How to synchronize the speed of spawned object and spawning time interval?

I want a stream of enemies coming from the top of the screen one behind other in a line, with their speed (speed of the whole stream i.e. every enemy) increased over time. When I simply increased ...
6
votes
1answer
196 views

How to make sure that the set of randomly spawning obstacles is passable?

Prompt Suppose we have a little mini-game where you have to avoid incoming obstacles by moving the blob up and down at a constant speed. The blob's x coordinate is fixed and the obstacles will spawn ...
2
votes
3answers
57 views

Spawn rates and variable time steps

How would I work a spawning algorithm into a sim engine with variable time steps? If each engine step is, say, 1/30 of a second and I have some event occur with a 0.001 probability each step, how do ...
0
votes
1answer
72 views

Object array in unity not instantiating properly

I'm trying to instantiate my CarMovement class with my population class for a Genetic Algorithm, but when i run the project, the car prefab doesnt spawn. Everything is wired up in the inspector ...
2
votes
1answer
327 views

How to spawn GameObject exactly in front of another object?

I'm working on a 3D game in Unity and I'm having a problem trying to spawn an object exactly in front of a wall in my game, like hanging a picture on it. I don't want the object to look like it's too ...
1
vote
0answers
38 views

Distributed spawning of units

I have a collision detection implemented in my game. Now I have spawning of units in a class Spawn: ...
2
votes
1answer
1k views

Instantiate a prefab on button press and keep it dragged

So far the gameObject is created, but I need to click on the object a second time, in order to start the Drag event. Here's the script where I use the button to spawn a prefab ...
-1
votes
2answers
502 views

How to spawn multiple objects in the same frame?

I wrote some code to spawn coins every 20 seconds but it spawns just 1. I'd like to make spawn coins from 1 to 4 coins randomly. Here's what I have currently: I found a solution for this script I ...
0
votes
1answer
383 views

Spawning random objects within certain boundaries in Unity

I know questions like these are asked a lot however non of the previously answered ones have helped me. I'm creating a game that spawns a specified number of different objects randomly on a plane. I ...
0
votes
0answers
120 views

Unity2D Randomly Spawn GameObject in an Area over another GameObject

I'm new to Unity2D (Unity 5.0.2f1) and have been searching for a solution which I'm sure is staring me in the face! I have a game object (essentially a road) like below (DirtTrack1): I have a ...
0
votes
1answer
48 views

FPS controller initializing at bizarre location

I have got the hang of basic construction, terrain modification, applying materials, placing trees, etc. I have created a water plane, positioned my terrain above it, and am able to sink lakes and ...
0
votes
1answer
296 views

Spawning/Updating objects from client

I hope this is the right place to ask my question... I have been working on a game (all 2D) and I'm facing some problem with the networking part (pretty much a beginner). My game idea is a shared ...
1
vote
1answer
219 views

Java libgdx: spawn particles around a point

There are particles in a box, the black circle representing the spawn point and the red circle representing the particles. How would you spawn them so they don't spawn outside the box, and so that ...
-1
votes
1answer
356 views

Spawn a prefab at random y position with different gap between prefabs

I have this code, and I want to be able to spawn my Wall prefab at random heights and gaps between the upper wall and wall under it, but it seems that my code will only spawn the wall with same gap ...
0
votes
1answer
275 views

Unity2D Multiplayer - Spawning player at user's end

I am currently into a 2d mobile multiplayer project. Its going to be a 2 player game for now. So the host and the client are the only players. I am using Unity 5.4 and the default multiplayer ...
0
votes
2answers
416 views

Unity2D: How to destroy spawned object once it exit out of camera's view?

I'm trying to destroy spawned objects once it exit out of camera view automatically/straight away. You see I'm trying to make a flappy brids type of game but things also comes in from the bottom and ...
0
votes
2answers
71 views

Unity2D: Repeating of code makes game lag (Spawnning script)

does anyone knows how to shorten down this script and that I can edit the amount of enemies I want to spawn in, so that I don't have to keep on copying and pasting the same method below again and ...
1
vote
1answer
142 views

How do I spawn more than one spawnpoint in my scene in Unity?

I have different enemy AIs and two spawn-points in a scene, so far. The problem I am having is that only one enemy AI spawns, and the other enemy AI won't spawn, in that scene. How can I fix this ...
1
vote
0answers
114 views

Unturned weapon modification not spawning in singleplayer

I've been working on my first modification for Unturned and I'm having some serious trouble doing the process due to the lack of up-to-date tutorials on modding weapons. I've done everything I can ...
0
votes
1answer
59 views

Why object spawn duplicate and double sides.?

I have a script, I am using this script to instantiate new path and also wall (as border) to generate new path and wall. Before some time all scripts work fine. but at this time my player enter in ...
2
votes
0answers
291 views

Unet spawning my 2 players in same location [closed]

I have min and max number of players set to 2. I have 2 empty game objects in my scene with Network Start Position scripts attached. I have "Round Robin" as the player spawn method in my Network ...
4
votes
1answer
2k views

Set a 'chance to spawn' for each GameObject in an array

I have an array of gameObjects in a spawner. I want to randomly spawn these gameObjects based on a weighted chance. I want to be able to manually set in the Inspector a percentage chance that an ...
0
votes
1answer
314 views

UNET spawn dynamically generated object unity

Spawning works when all clients are connected, but if a client connects after I spawn all my prefabs there are errors. I spawn the object before changing its Rigidbody's velocity, which seems to ...
1
vote
1answer
989 views

Libgdx spawning enemies at random time

Hello I want to spawn enemies at certain location but at random time,like for example every 10 seconds. Atm I am spawning enemies whenever I click to spawn heroes but with delay, but I sure does not ...
1
vote
1answer
217 views

Spawning Object 1 Within Object 2's Collision Box [Gamemaker]

I was wondering if any of you could help me with a specific Gamemaker question. Am using Gamemaker Studio. I have an object (oSpecialSolid) which rotates and moves across my level. At random ...
2
votes
2answers
2k views

How to randomly spawn obstacles for infinite runner?

I am trying to create randomly generated path properly? Think of flappy bird (its not really) but my code/algorithm is all wrong. If I make BarMax, BarMin too large, then player can cheat cos in ...
0
votes
1answer
174 views

Extra sprite spawning when the enemies are redrawn SFML

I am making a game in sfml and at the moment when all of the enemies die. They are set to respawn however when this is happening they are respawning with one extra sprite than before. The code for ...
3
votes
2answers
5k views

How do I spawn an enemy at one of many spawn points in Unity?

I have a spawn script that so far only creates one Enemy spawn point and enemy trigger while only spawning one enemy. Instead, I want it to create multiple spawns and triggers, but keep it such that ...
1
vote
0answers
132 views

Particle System Tracking

I have a particle system where instead of tracking the time each particle is alive, I just track the time of the oldest particle and the time of the youngest particle. Basically, the oldest particle ...
4
votes
2answers
814 views

Why should I use a list of enemies instead of an array of enemies?

I have been making 2d shooter similar to galaga using xna in C#, where the enemies (2 types) are all in rows above the player's ships, and are supposed to randomly launch attacks. I had previously ...
1
vote
1answer
1k views

making a monster encounter method

I'm currently making my own little 2d text based game and I've got a 11 / 11 grid where a monster spawns in the middle and when i stand on it's position and it brings me to another 11/11 grid where i ...
0
votes
2answers
681 views

How can I make a power-up spawn system semi-random?

Basically I'm working on a similar game to achtung die kurve (http://curvefever.com). I'm almost done with the game, however I'm not completely fine with the way power up spawning works. As for now, I ...
4
votes
2answers
518 views

Obstacle spawn constraints in Jetpack Joyride

Jetpack Joyride: https://www.youtube.com/watch?v=3KENMuzsras tl;dr What's the best way to add constraints to obstacle spawning (algorithms) or how to design obstacle spawning to allow constraints? ...
-1
votes
1answer
103 views

Movieclip to spawn in in a set perimeter

I like to make a movieclip randomly spawn in a set area. But theres a little more to it, usually you'd have something like the X pos set to something like 250 (say the centre) and the Y pos set to be <...
2
votes
2answers
209 views

Fair spawning of players on a 2D grid

As new players enter a game, they are given a location on a large grid. The first player is given the location in the center. Now, how should the second player be placed? Then, the third and so on? ...
2
votes
3answers
1k views

How do I write a wave-spawning system for a shoot-em-up?

I recently played Knightmare Tower and was amazed by the way how different monsters are beign spawned. I'm aware of time-based and count-based spawing systems in shoot-em-ups. Count-based systems ...