Quantcast
Channel: Questions in topic: "clone"
Browsing all 508 articles
Browse latest View live
↧

How can I destroy an specific clone already instantiated, when there's more...

Hello community. Now I'm generating a game object that's name is "PowerUp" and when it's instantiated the name is "PowerUp(Clone)". By now I'm destroying it by contact, the "PowerUp(Clone)" that's...

View Article


How can I get the x position for the left(and right) of the screen?

In Unity, I am making a game where spheres spawn at a random position. I want the spheres can spawn a little outside the screen. This is the code where the spheres spawn: `Instantiate (sphere_prefab,...

View Article


Deep clone a gameobject

I tried searching around for this, but I wasn't able to find an answer. I have a gameobject with a custom component attached (C# script). This script has several variables that have been set previously...

View Article

Spawn Gameobject at Cloned Gameobjects gameobjects

I want to spawn an object at a cloned gameobjects 4 gameobjects positions. My code right now will spawn 4 watermelon_split object at the watermelon clone, but not at the watermelon_split1 position or...

View Article

Create a clone and change his size

Hello, I'm working in a 2D game and what I'm trying to do is very simple I guess, but I can't solve by myself: "When the player click in a object, create a clone and put the clone at X, Y and change...

View Article


Duplicated object and original behave differently

In the example Scene, I have an "Arm" made up of a few hinges. I am using the motors in the arm to control the movement. The original arm works as expected, but when I create a copy (using ctrl + D),...

View Article

How to create an array of clones for a seperate Save/Load script

There are answers to similar questions out there, but as a total novice I can't quite put them together. I want all clones created from a prefab to be put into an array so that said array can be added...

View Article

Desroy clone

MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it. Your script should either check if it is null or you should not destroy the object....

View Article


scripts gets disabled when the prefab is instantiated

I have two script named **inst** and **coll** and two gameObject , one is empty and the other is the instance of prefab named **Car** . **inst** script is attached to the empty gameObject and its...

View Article


Changing sprite alpha on all prefab clones

I'm trying to change the alpha/transparency of all clones of the prefab. The transparency of the prefab itself changes correctly, but when I put multiple clones of the same prefab in the scene only one...

View Article

Rotation eulerangles not adjusting correctly...

I am trying to make a simple flappy bird clone (in order to act as a sort of practise / first game, NOTE: This is not my first game). I am trying to imitate the rotation that occurs whenever you "fly"...

View Article

How to stop instantiate spawn ?

Anybody know how can i stop cloning object when the game finish / times up ? I'am using InvokeRepeating to clone object, this is the script : using UnityEngine; using System.Collections; public class...

View Article

Bacteria/Cell Growth

Hi there, I am trying to code some basic bacterial growth into unity. I would each clone of my capsule to appear from the position of the clone that created it. However, at the moment all of my clones...

View Article


how to get the prefab path of a game object in Game mode,not Editor mode

hi, as the title says,I have a game object ,and it's cloned from a prefab, is there any way to get the prefab path from the game object? I know there is a API "PrefabUtility.GetPrefabParent",but seems...

View Article

When I use Object.Instantiate, it creates a bunch of clones

I use the code: GameObject fire = (GameObject) GameObject.Instantiate(gameObject, transform.position, transform.rotation); to create a clone of my bullet, and when I use it for the first time per...

View Article


How can you load next the level after you destroy the last clone c#

I am almost complete with my game but I am just stuck on one part. I have to implement some statement that says when the last clone is destroyed the next level is loaded. Except I do not know how to do...

View Article

Clone Meteors in Area

I cant figure out how to make a GameObject clone itself, randomly around the sky, but only under a specific area. I tried random x y z and cloning, but it doesn't work. Please help! I am trying to make...

View Article


Find if object is at a point?

Hello, I have a set of coordinates. There is an object at this point. I want to destroy this object. How do I do this? I can't use Find, because it's a clone.

View Article

How can I change this script so that each instantiated prefab spawns a set...

How can I change this script so that each instantiated prefab spawns a set amount faster instead of increasing speed over time. e.g first clone spawns with a speed of (2.5f) then next spawned clown has...

View Article

SetParent UI Text to Canvas [Instantiate]

Hi there, _Graham, please don't add the error code as a tag again. It didn't help the first time or the second time. I need some actual help with this._ I'm trying to clone a UI.Text with instantiate,...

View Article
Browsing all 508 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>