Quantcast
Browsing all 215 articles
Browse latest View live

when testing in the game mode , shots don't fire ?

iam following the official unity space shooter tutorials but in 2d space/orthographic setup and my player is just a 2d sprite/.png the shots fire only when i drag the shot prefab into heirarchy in game...

View Article


Custom Header with WWW Get

I found a code example someone put up that said you can add a header to your Get request by leaving the postdata parameter null. What's happening to me is that when I include the headers I got a 404...

View Article


How to get an object with exact coordinates?

Hello everyone, my first Question I'm posting. Basically what I'm trying to accomplish is getting an object(collider object) using the exact coordinates given. What I've been hoping and trying to...

View Article

Is there a way to get the symbolic String name [editing name] of a variable...

Hi UnityAnswers Community, I was wondering if there was a way in C# to get the symbolic name of a variable at runtime. I am saving to disk several properties of a Scene in the form of "STRING=value"...

View Article

Problem with input code for a camera follow/rotate script

I am trying to make the camera follow the sphere, but let me pivot the camera around it. I have this script but when trying to set up the controls I am having an issue. The spherecontroller, and the...

View Article


Get values from long string (C#)

Hi I am currently integrating the Facebook Unity SDK in my game and when I load an app request, I get this result from facebook: { "id": "453305136468701", "application": { "name": "TEST_APP",...

View Article

Instead of "new" for accessing properties?

hey guys! so im pretty new to unity but i know a little bit about programming. so as the title says. im looking for an alternative way of access my properties. also im trying to figure out how i can...

View Article

How do you get child and grandchild?

I have a GameObject which contains children and grandchildren. I would like to change the layers of the entire Parent folder with another layer. Currently the parent and her children I was able to...

View Article


Help with static variables not being saved

I made a script where all my scripts are written, I access them periodically so I don't have to write the same script over and over. Now I have a problem when I set a variable and read it again its ok,...

View Article


troubles with changing scenes

hellooo, i'm having a little problem with switching scenes on my game, what im doing is trying to make a playable tutorial, there are some visuals on the screen telling you to press 'a' and i want it...

View Article

Editor Script: Getting all the models in a folder.

I want to make an editor script that will generate gameobject prefabs out of all models in a specified directory. I got the menu GUI all setup, but I'm not sure how to do the logic. Specifically,...

View Article

boolean questions get, set, in java.

so I was watching a video one the made a Boolean in c# that looked like- public bool name { get; set; } how is that different then a true false, and how do I write that in JavaScript?

View Article

Problem About Get and Set Methods

Hello guys, I have problem about encapsulation. I have learned that in Java and as far as I know it works the same way in C# but in Unity It does not work. I will show you. public class AnotherClass {...

View Article


Get a rect from a UI Button

Hello. I'm trying to get a rect from a UI button from a canvas with render mode "screen space-camera". But I can not do this. I did it in the Update: rectbtpause = BtPause.GetComponent().rect; So, when...

View Article

Async Get Request Android?

Hello everyone, I need your help. Simple task: when user push the button, we need to send GET request to server(response is not necessary). The next code is working on the computer, but is **not**...

View Article


When to use SETters and GETters

When and where should you use setters and getters? I'm guessing it's instead of public variables for a structure?

View Article

Getter Working, Setter not.

using UnityEngine; using System.Collections; public class BaseSkills : MonoBehaviour { int strBase = 1; public int Strength { get{ return strBase; } set{ strBase = value; } } Top is my getter and...

View Article


Opening External Login Page

Hi all, I have an app running on Google App Engine, which provides endpoints for GET/POST requests (and a DB). It also comes with built-in authentication via Google accounts. I would like to open up a...

View Article

Public variable hidden in the inspector

Is there a way to see this variable in the inspector? e.g: public string pigName { get { this.gameObject.name; } } I want to see the variable in the inspector for debug purposes and I don't want to...

View Article

How do I get an objects position once?

So, I'm creating this game where you fight against giants. The giants are moved by navMeshAgents and they use a RayCast to check there's nothing in between them and the player (like walls and such) to...

View Article
Browsing all 215 articles
Browse latest View live


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