Quantcast
Channel: Questions in topic: "instantiate-game-object"
Browsing latest articles
Browse All 64 View Live

AddForce not working on Instantiated Object

I had an object that was in my hierarchy and when certain conditions were met, a force (AddForce) was applied. This worked very well until I made a prefab out of the original object… now, the object is...

View Article


[4.6] Instantiating an object within a ScrollView makes the object invisible

Hey, So I am trying to instantiate some objects within a ScrollView to make a notifications window/panel thing. The problem I am having though, is that for some strange reason some of the notifications...

View Article


Unable to instantiate Objects One Below another.

I want to Instantiate game objects one below another but when I run my script it showing objects one after another,tried lots of ways but unable to achieve it.Whats wrong with my code ? Following is my...

View Article

Randomly instantiating a list of objects at a random position.

Hi. I recently tried asking this question but I realized it was not a sufficient question. In my game the player is climbing up an infinite wall. I would like objects to fall and try to nock the player...

View Article

Trash Collection for Instantiated Objects

Hi. I know I recently posted a question similar to this, but please ignore that one. It did not provide sufficient detail. Here is the new version. Anyways, in my game the player is climbing up...

View Article


Instantiate Game Object from different Script in different Objects

I have a GameObject stored in a static variable in a script1 in Object1 static GameObject Immagine; And I want to instantiate the gameObject with script2 in Object2 var g : GameObject;...

View Article

Instantiate as a child properly

So I found need to Instantiate a prefab as a child of object, but i'm not sure how it is done and I am always getting an error:> NullReferenceException: Object> reference not set to an instance...

View Article

problem with setting values of newly instantiated object

I worked 2 days to make me feel well with this script and now it's making problems. When I instantiate a new GameObject with this script attached to it, I somehow can't set any values in objects that...

View Article


Instantiate GameObject on Enum Selection from Inspector

I'm wondering how to go about instantiating (or destroying) a new GameObject when a specific enum value is selected from it's dropdown menu in the Inspector window, prior to run-time. Does anyone know...

View Article


how can I stop instantiate process

I want to instantiate a GameObject 200 times in special position (as a block for player) and stop this process after 200. but I dont know how :). this is my code using UnityEngine; using...

View Article

Instantiating text far right.

Hi I have been following this [tutorial series][1] and he is using instantiate, I followed each and every step but my text is appearing far right instead on the tip of the sword which is were the...

View Article

respawning enemies that recognize player

Trying to get more mileage from my prefab enemies. In their ATTACK scripts they seek out the player by his transform - a public variable I drag and drop "player" into and all is well. When I respawn...

View Article

How to make unity to continue focusing a the GameObject after it instantiates...

Hi I did a Unity Editor script called LevelManager. It instantiates and places new level objects to the scene where you click on the screen. The problem is, after it instantiates a GameObject and place...

View Article


Instantiating game objects - shallow or full copy?

Let's say I have this short script here, found on a Unity official site: using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { public Rigidbody projectile; void...

View Article

How can I have an access to the rigidbody component of each instantiated object?

In Game Controller script, I have instantiated a stream of balls falling from top of the screen. I stored the references to these instantiated objects in a list whereby I can access it using...

View Article


[Solved] Storing a GameObject in a var and then instantiating it in a new scene?

Hi. I'm creating a game in which a player can access a menu and jump between multiple scenes. I tried to use DontDestroyOnLoad (), but if I jump to another scene and back, I will have two players. My...

View Article

Instantiate an instance?

Hi, I'm about to do something i don't know is accurate. It works, as well it seem so on the surface, but I'm not sure of the implications this method might have. What I am trying to achieve is to keep...

View Article


How to instantiate a platform each time another platform is 3 units away from...

I will explain my situation better![alt text][1] [1]: /storage/temp/109942-unity.png I want the top bar to set up gameobjects (platforms). Each time a gameobject that has instantiated this at a...

View Article

¿como instanciar una plataforma cada vez que otra plataforma este a 3...

explicare mejor mi situación. ![alt text][1] [1]: /storage/temp/109945-unity.png Quiero que la barra de arriba instanceé gameobjects(plataformas). Cada vez que un gameobject que haya instanciado este a...

View Article

Instantiate script for randomly selecting sound is suddenly creating New Game...

Hello! I'm using this script to randomly select an audio from a list of 3 and it instantiates it into the game then the sound gets deleted after it finishes playing. The script was working perfectly...

View Article

[Help] How can I instantiate game objects across a field while some objects...

I currently have two working scripts. One which spreads a randomized number of collectible gameobjects across an a given field, and one which gives a probability of being instantiated to 6 levels of...

View Article


Equivelant "set" method for "getInstantiatedObject"?

I'm using a script to generate the map for a game on a Tilemap. I want to randomly populate tiles on the map with game objects, but can't get it working quite right. I have objects being created at...

View Article


Save a obj and spawn it without make prefape

hello every one, I am trying to save an GameObject to Crate it again in another scene but maype someone says use prefab , my GO(GameObject )is not the same every time ,the player edit it so I cant use...

View Article

Instantiate question

Hi, when instantiating an gameobject is there anyway I can have the values in the instantiated gameobject script be the same as another gameobject already in the scene? Here is my code: public class...

View Article

Instantiate an array of 2d platforms

Hello I have an array of 2d platforms that I want to instantiate one after another at run time so that it looks like an infinate 2d runner. Each platform is 15px wide so I guess I want to spawn every...

View Article


Keeping position of game objects when leaving play mode

I use Unity to create simulations to move objects in a 3D world. I'd like to keep the position of the moved objects when leaving the play mode to use this position in other softwares. I found a lot of...

View Article

Player object not instantiating at where I want it to

Whenever my player gets destroyed, I want it to be instantiated at the transform.position of a specific game object, of which I have named revivePoint. I have 2 scripts and 1 game object relating to...

View Article

Looking to destroy clone of gameobject without destroying original

Basic idea: Crate prefab spawns. If you double click on the crate, it instantiates a larger version of that, a sort of 'zoom in' on it, to show details. If you then click outside of the panel, it...

View Article

Cloned gamObject have no gravity on release/detach,Cloned gameObject have no...

Hello everyone, I am testing XR stuffs, and I'm messing around with the grab event. In this test, I want to "clone" a gameObject so it can be grab indeffinetely (and copied) This is how I do it using...

View Article



Instantiating GameObjects from a List

I am trying to draw cards from a List 2 at a time in order. Then moving those cards to another list so they are not drawn again on the next click. I almost have it working but the order seems to be...

View Article
Browsing latest articles
Browse All 64 View Live


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