Questions tagged [spawning]
143 questions
0
votes
1 answer
Spawn object with custom script with Unity Network
I have a PlayerPref that spawn more objects in OnStartLocalPlayer().
So in OnStartLocalPlayer() it call Command(assume that called on server) that instantiate GameObject and setup some values of its scripts. At the end it calls…

maximelian1986
- 2,308
- 1
- 18
- 32
0
votes
1 answer
How do I properly Object Pool enemy waves with an IEnumerator
Hopefully someone can help me with this issue. I'm trying to couple an IEnumerator with my object pooling script to instantiate enemies in waves. But I can't get them to instantiate without immediately destroying themselves 2 or 3 times and then…

Millie
- 1
- 2
0
votes
1 answer
Unity3D: delete spawn objects
I have a 2d game where there is an original enemy ninja. I created spawning script to clone my original ninja. I then placed it on my main camera to make my ninja clone spawn within the main camera view. My original ninja also has a script that…

Jessca Stone
- 211
- 3
- 13
0
votes
0 answers
Making a spawn button in Unity2D with the following script
So I want to make some kind of button (either with or without UI) in unity 2D which spawns a "tower" and then I drag it to the desired location.
The script dragging script is as follows:
using UnityEngine;
using…

Angel Vasilev
- 77
- 1
- 9
0
votes
0 answers
Null Reference Exception for target in a script on a newly instantiated object
What I'm trying to do is spawn an enemy and create a marker/blip on the Minimap for the spawned enemy.
I get a NullReferenceException at line BlipCtrl:29.
The Blips on the Minimap have a Target GameObject which position reflects the position of…

Merlin Jackson
- 142
- 10
0
votes
1 answer
Spawning in Unity: Spheres flying out of range
I am programming a game in Unity. I am trying to spawn a sphere in space everytime the user clicks the interface. I can spawn the spheres, but the spheres are always at coordinates of around (200,200, 0) and (400,400,0), but the spheres should be…

Brenda So
- 191
- 1
- 8
0
votes
1 answer
How to spawn enemies with a randomized speed
I would like to know how to spawn enemies with a randomized speed. I've looked around on the Internet looking for solutions, but none of them seem to come close (or maybe I haven't looked hard enough, I'm not sure. If there's a solution somewhere…

Darren Loke
- 23
- 4
0
votes
2 answers
Spawning multiple nodes in different locations
I'm trying to spawn multiple SKSpriteNodes within the set location, but when I add multiple nodes they just spawn on top of each other? Is there a way to not make this happen?
I'm also having a problem of having to refresh the page in order to get…

MattJB
- 13
- 6
0
votes
1 answer
Spawning down the middle of the screen
Is there a way to spawn an SKSpriteNode continuously down the middle of the screen. For example I have a circle that I want to spawn in the middle of the x axis and then for that node to spawn all the way down the screen?
These circles are…

MattJB
- 13
- 6
0
votes
1 answer
Spawning in multiple positions
Is there a way to spawn randomly in multiple positions for example, I have four SKSpriteNodes which are the locations of where I would like another node to spawn inside of.
These are locations of where I would like the new node to…

MattJB
- 13
- 6
0
votes
1 answer
How do I detect if the user touched my Sprites/screen?
Basically, the sprite is spawned at a random time every (1,2 or 3 sec) and infinitely. I want the sprite to disappear once it's touched on the screen. (android touch event)
public void newEnemy(){
Sprite…

Kevin Bryan
- 1,846
- 2
- 22
- 45
0
votes
1 answer
Spawn objects in a game level at set time
I need a way to spawn objects in a level at set time. I know I can do this with If statements by checking the time variables, but this idea is stupid because it checks ewery update if its the right time and this will make my game slower. Is there…

Simas
- 31
- 1
- 6
0
votes
0 answers
Possible options/bugs that may cause Internet Explorer to spawn multiple tabs?
From an HTML/JavaScript perspective I'm currently aware of 2 methods to spawn a new browser tab (or window).
An HTML form

scunliffe
- 62,582
- 25
- 126
- 161
0
votes
1 answer
libgdx creating multiple objects in different places
I want to spawn my item (Sword1) in random places. When i spawn it, first of all it only creates 1 of it, then it moves randomly everywhere. Should I create and array for the object? How?
public class Sword1 {
public static…

ill feedyou
- 1
- 4
0
votes
0 answers
Object not destroying after reaching a certain point Unity
Okay so i'm making an infinite runner and the technique I've used is to keep the player static and move and instantiate the platform objects.
For that I've created an Array List of objects that are the platforms.
And then I'm adding them in and…

momal
- 576
- 2
- 13
- 30