Quantcast
Channel: Latest Questions on Unity Answers
Browsing all 171066 articles
Browse latest View live
↧

Spawn an object every time i=+5

I want to spawn a game object every time a public variable is 5 more than the last for example 5,10,15,20.... but how can I do this? I was thinking of making something like public var i:int;...

View Article


When does the "InstanceID" get assigned, and does it seralize with the Object?

I have a couple of related questions about the instance id in `UnityEngine.Object` (that you could get via `GetInstanceID`) 1. When does this ID get assigned? (I assume it's when the object is...

View Article


Change Scene after time?

I have been trying to change the scene after a certain by using yield waitforseconds, and application load level to get the job done. But it gives this error " It is not possible to invoke an...

View Article

Music player - get songs from directory.

Hi guys, i've made this music player, the songs are added from unity editor, how can i do for create a directory folder, so that the songs that must be reproduced are taken from there? #pragma strict...

View Article

DrawTexture simpleproblem

Hi! I've never used DrawTexture before, but from the unity documentation i'm not sure where i'm going wrong. Thinking perhaps maybe I'm loading a wrong type of image or size? The problem is it seems to...

View Article


Touch Input on Sprites

Hey. I've been trying to figure out how to make a control for my game. I got the idea to take a sprite and if the finger is on this sprite it should act like Input.GetKey. (A sprite also doesn't change...

View Article

Time.timeScale doesn't stop void update() from beeing run

Hello, I'm working on an mobile Android game. It's somewhat similar in mechanics to flappy bird in that each attempt is not going to last very long so I want as little as possible between the player...

View Article

infinite runner HELP

this is my code but there a 2 problems that wont let me start. the problems are; Assets/Sample Assets/2D/Scripts/PlatformerCharacter2D.cs(90,76): error CS1526: A new expression requires () or [] after...

View Article


How do i call a function in main script from editor script?

Hi. I made a javascript ("DetailMassPlace") to autogenerate grass detail on a terrain. I need to make another script ("DetailMassPlaceEditor") to create a button in the inspector to apply the grass. My...

View Article


animation.isPlaying is not working

This is my code for my script var check = false; function Update () { if(animation.isPlaying){ check = false; } if(!animation.isPlaying){ check = true; } } I am using a simple technique to check if...

View Article

newbe scaling maze sceen for different resolutions

Hi I'm quite new to game programing and unity so please be lenient if the questions that seem silly. I tried to make a proof of concept game to learn the platform. I thought of something teeter like. I...

View Article

Using Loops

sorry for my bad English! i have a custom class: public class playerData { public string name; public NetworkPlayer player; public Transform Prefab; public bool isReady = false; } and a list: public...

View Article

Unity card game issues

I have just joined a university and and currently working on a project that will involve me creating a card game. For this project I am still tossing up which card game I would like to implement,...

View Article


Returning an array[i] value

Hi, I've got this simple little function that'll sift through items i've collected and display their names as buttons. I'm trying to get it so that the buttons display the objects text, but I need to...

View Article

Trying to Disable Compenent when there's a collsion

Im trying to tell Unity that im the character collides with a certain area then it should disable the character controller. But i cant seem to disable the Compnenet or the Script.... PLEASE HELP...

View Article


GUI Text element disappears when I am trying to change its position

I wrote the following code to keep the score of my game. #region Score private GameObject scoreobject; private int score; public void InstantiateScore() { score = 0; scoreobject =...

View Article

Animations not working

Whenever i create a rig and animate it using keyframes, i export via .FBX and import it to Unity. Unity picks up the model and even the animation as "Take 001". When i try to apply this animation to...

View Article


Getcomponent null reference exception

Why am I getting a null reference exception when I call the hear noise function? NullReferenceException: Object reference not set to an instance of an object this class is attached to a crate object...

View Article

Cursor size

Hi! Is it possible that I can make cursor bigger? I use my png image and it's very small (image size - 256x256 px).

View Article

Error in code! Help me please! =(

Hello everyone, I'm new to c # and I can not understand the error code: using UnityEngine; using System.Collections; using System.Collections.Generic; public enum TerrainType { Lowlands, Highlands,...

View Article
Browsing all 171066 articles
Browse latest View live


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