Tagged Questions

Unity is a highly cross-platform engine that focuses on easy art pipeline process and uses Mono as its scripting back end.

learn more… | top users | synonyms (1)

0
votes
1answer
37 views

Trigger scene loading in one device from another device using Unity WWW class

I have a master device and client device. I want to load a scene in the client device by pressing a button in the master. My method is, when the button is pressed in the master device, a data is ...
0
votes
0answers
40 views

How to upload binary image data via POST in Unity through load balancer?

I want to use unity to upload POST binary to the server. However, my server used HAProxy and it triggered an error "The remote server returned an error: (417) Expectation Failed.". The cause of ...
2
votes
0answers
69 views

Why is OnCollisionEnter2D called when it's layer's collisions are being ignored?

I'm sure this is down to my lack of understanding of the unity physics system. I'm trying to implement a simple one-way platform for a 2d game and have got stuck on creating a reliable way to let the ...
0
votes
1answer
43 views

Copying a texture's colors to a new texture to create a new sprite

Let mySprite be some .PNG sprite: Texture2D tex = mySprite.texture; Sprite sprite = Sprite.Create(tex, new Rect(0,0,tex.width,tex.height),new Vector2(0.0f,0.0f),1.0f); The resulting sprite can be ...
0
votes
0answers
10 views

Unity 3.5.7f6 font style of one object is linked to another object [duplicate]

I'm using Unity 3.5.7f6. When I edit the font style of one text area on one object, it changes another font style on another object to the same font. Is there a way to break this bond/link of font ...
3
votes
2answers
142 views

Find a position within one radius, but outside other radii

I have an Object A which will attempt to stay within a certain distance of another Object B. I would like Object A to also try to stay outside a certain distance of one or more other Objects R. The ...
0
votes
1answer
75 views

Getting the Halo property of a point light in Unity

I am adding point lights in my scene ( max 6 ) and I want to be able to enable its Halo property via script. However in the documentation reference, they haven't mentioned how to enable the halo ...
0
votes
1answer
65 views

How to combine the camera that follows the player and the camera shake effect in Unity?

I need to combine both camera that follows the player and the camera shake effect in the same moment. The problem is in that, if I make the shake effect for the camera, then the camera doesn't follow ...
0
votes
1answer
76 views

Alternative to Update()

Here is my noobish scenario I'm trying to understand: Some class, Terrain: void Start() { ... switch (Type) { case TerrainType.StartPoint: ...
0
votes
2answers
112 views

Avoiding singletons for puzzle system [closed]

Say for instance I have a puzzle with 3 switches that need to be in some configuration (say all on) in one room, that opens a door in another, with a load screen separating, so I can't link the ...
2
votes
1answer
96 views

How can I access a script variable from another script in Unity?

I'm creating a space shooter (think Space Invaders or Galaga) where the GameManager persists between scenes but the player and enemies don't. I need to access a boolean value from the player and ...
0
votes
0answers
13 views

How can you duplicat folders and not share old dependencies in Unity?

I have a folder with some prefabs, materials, textures, FBX, etc. My Prefabs refers to FBXs and Materials in this folder. Can I clone this folder in a way that it will save those local dependencies? ...
2
votes
2answers
101 views

Calculating gameObjects hit by a directional light source

I am trying to figure out in my current game whether a gameObject is lit by a directional light or not. Below is my image inside the Unity game engine As my game runs around a Day/Night cycle, I ...
0
votes
0answers
62 views

Create a sprite in Unity that has a border that does not change its width when scaling

I am trying to create a box that has a 10 pixel border and when I scale that box I would like the border to stay 10 pixels no matter the size. I am currently trying to create an empty game object ...
-4
votes
1answer
73 views

Move an object based on XML/TXT file [closed]

Let's think I have an file which looks like this: 0 1 2 3 4 5 6 7 8 9 10 11 I want to create a move from this file. For every 1s(mentioned in the file) I want to move the object. Is this ...
0
votes
2answers
104 views

I want to show total time spent by all players around the world in my game

I am developing a Unity3D game. I want to show in my game: Total time spent playing all time by all players around the world Total time spent playing in last 24 hours by all players around the world ...
0
votes
2answers
137 views

Unity yield WaitForSeconds() not working

I am new to Unity development. I started learning Unity by reading tutorials, demos, examples, and watching videos. And I am having some trouble with using this timer. Here is my code: void ...
2
votes
1answer
101 views

How to share values between different shader programs?

I am using Unity but this might concerns all type of shaders. I would like to know if this is possible to share values between different shader pass.Let's imagine that I am computing something in the ...
0
votes
0answers
116 views

Creating a arc path connecting two GameObjects in Unity

I am working on a game on a spherical surface which first of all is a big challenge in itself. I want to create a path on an arc which connects two points ( seen in the image ) and show an arc path ...
0
votes
0answers
34 views

Push Notification to start a scene

I was wondering whether I can use APNs in iOS to trigger an event in my game, like start a scene without user clicking the notification. Is it possible to use remote push notifications for events like ...
0
votes
1answer
108 views

How to render the sprites for a 2D soft body physics system

This is not a question as to how to achieve soft body physics, but rather if I have a mass-spring system how to modify a sprite with that information. I am using unity so I dont have access to vector ...
0
votes
0answers
63 views

How to move rigidbody player to its facing direction with AddForce?

How can I move a rigidbody to its facing direction? I've already tried this: rigidbody.AddForce (transform.forward * v, ForceMode.Acceleration); // v is a public float which gets a new value in ...
0
votes
1answer
44 views

Using IPAD's as controllers for a Unity game

We are making a Multiplayer game using Unity. The actual game would be run from a PC projected on a screen and the players would be using their respective Ipad as a controller to play the game. I am ...
-3
votes
1answer
46 views

Move the Object in y-axis when the timer increases [closed]

I have a model(.Fbx object),I have placed a timer.When the timer starts increasing the model/object should move down(along y axis).
0
votes
0answers
47 views

Texturing problem inside Unity

So I created a Hex Sphere using Houdini and exported it as FBX to Maya where I created UV's for the model to use it in Unity This is how my sphere looks inside Unity All the hexes are separated so ...
0
votes
1answer
72 views

Calculate needed speed and object's position in Unity3d

So i'm trying to calculate object's future position so my enemy can land to it safely. Idea is that using future postion I can calculate angle and convert it to direction vector and also using ...
0
votes
1answer
60 views

How can I inspect 3D model exactness? [closed]

I am neither a game designer nor a graphic designer. I am a .Net and C# software developer. I have a game project and I've still been studying to learn game concepts and technolgies for a year. ...
1
vote
4answers
287 views

How to read a data from text file in unity

Can anybody help me out with giving the steps needed for reading data from the text file in unity and how can the script be added.
0
votes
1answer
96 views

2D object grids to a dictionary

I'm pretty new to Unity and trying to figure out what a good way of transferring objects in a grid to a dictionary would be. For example, if i have a grid of 2D objects (squares) such as below ...
2
votes
3answers
179 views

How do I check whether a camera has unobstructed view of a GameObject?

I want to check if a GameObject is visible to the camera. The renderer.isVisible-method only checks if the camera is turned towards the object, not if there is anything between them (like a wall). ...
0
votes
1answer
60 views

How do I raycast to detect which hexagonal tile was clicked?

I want to detect the hexagonal tile a unit is on upon clicking on the unit. I was thinking of using a ray cast I can't get it to work. I'm trying to get the raycast to shoot from the bottom of the ...
0
votes
0answers
24 views

Changing a single component of a prefab?

I'm working on a unity project and I'm looking to show the range of a certain character. However, the terrain is generated through a script at run time, and considering that the script uses the ...
0
votes
0answers
53 views

Scaling issue using a GUITexture on a sprite object in unity

I'm trying to make a Kinect game using MS-SDK wrapper from the Asset store in Unity, In the kinect manager script the Hand Cursor object is where you can set the gameObject you want to act as a ...
1
vote
1answer
96 views

Can I use flat shading on a generated mesh?

I tried to generate a mesh from code in Unity. The problem is, that the edges are automatically smoothed. When I import a model into Unity, I can set the smoothing angle of the edges, but is something ...
1
vote
0answers
86 views

How do I implement melee hit boxes for a top-down game?

For a 3D top-down game, how should I handle collision in melee combat? My game has no targeting system, so I can't use a simple distance check between attacker and target. What I am thinking is have ...
0
votes
0answers
31 views

Can not change rotation of prefabs

var angle = temp.transform.rotation.eulerAngles; angle.y = 90; temp.transform.rotation = Quaternion.Euler (angle); I have tried this and some other variation to change the rotation of ...
1
vote
0answers
87 views

Fixing text on the screen for Oculus Rift

I would like to fix text to the screen for an Oculus Rift in Unity. The text should say something like "get comfortable and then press any key". It seems like OVRGUI.StereoBox should work for this and ...
0
votes
1answer
61 views

Skipping a loop in foreach? [closed]

I'm trying to get Unity to filter through a list of nodes, but I am unsure on how to do so. This is what I have derived. foreach (TileNode z in map.nodes) { int num = TileNode z; ...
0
votes
0answers
16 views

Working with random numbers in Unity [duplicate]

I am randomly trying to generate few regions ( grass, ice, snow and water ) for one of my games inside Unity. Every time the game starts, these regions are randomly generated but at the same time I ...
1
vote
1answer
63 views

How to deal with tags in a component

I have a component called "ReflectOffCollision". This component should obviously not need to be aware of specific details about the game such as tags. The problem is, I want to apply this script to an ...
0
votes
1answer
205 views

Bad quality of the sprite in Unity

I need to import a few sprites (background platform and sky) into my game scene but it seems that their quality after importing into Unity is too bad (they are blurred). The original resolution of ...
0
votes
1answer
47 views

Why does changing texture change it for both objects? [duplicate]

I have two identical objects in my Unity scene. When I change the texture of one, the texture is changed on the other, almost as though the first one is a prefab. Why is this happening and how can I ...
0
votes
1answer
91 views

What is the speed difference between cross platform HTML5 games and native mobile games? [closed]

Microsoft is advertising and promoting cross platform HTML5 game development. I am thinking of creating a simple 2D side scroller game and I am trying to decide what engine should I use for creating ...
1
vote
1answer
146 views

Mouse click movement

I need to make realistic human movement (3D) using mouse click. Get mouse click point using Raycast. Smoothly Slerp to LookRotation. Move transform.forward. Everything works fine, except I have ...
0
votes
1answer
104 views

Enemy clones don't target player

In a small game that I'm making enemies multiply when you kill them, however when clones are instantiated they don't chase the player like the original prefabs do (example: ...
1
vote
0answers
49 views

Can I switch off scenery elements on a 3D model?

I am using a 3D asset that has flat scenery elements (3D island with 2D bushes). [1] Having encountered a number of problems with this scenery [2] I want to deactive it (not visible, not collidable, ...
-1
votes
1answer
63 views

How do we detect keypresses in a sequence? [closed]

using UnityEngine; using System.Collections; public class TrollingRowlandMK2 : MonoBehaviour { int cheat_progress = 0; float cheat_delay = 0.0f; void detect() {if(cheat_progress == 0 ...
0
votes
1answer
42 views

Combination Keypad in Unity

Im having a slight problem in getting my Combination keypad to work. Ok so basically I'm using gameObject buttons to use for the numbers 0-9. So each gameObject button has a number link to it. The ...
0
votes
0answers
114 views

Calling an android method from Unity3D with a JAR plugin

I am developing a game with Unity only for Android platform and I am requiring to share content of my game through an intent so I have implemented a JAR plugin according to several tutorials with this ...
1
vote
0answers
71 views

Dynamic Level Loads [ Story Saves ] [closed]

I have recently revisited the legend of zelda series and got inspired by it to create a game similar to majora's mask. After some slight work on the player movement and key game mechanics I started to ...