Unity is a cross-platform game creation system that focuses on easy art pipeline process. It consists of a game engine and an integrated development environment. The game engine's scripting is built on Mono.

learn more… | top users | synonyms (1)

0
votes
0answers
50 views

Unity directional light for a day night cycle on a hex sphere

So I am trying to create a Day Night cycle on a sphere but it doesn't work the way I want it to. As the model is hex tiled, you see the edges of the hex tiles also lit up like below. I am using a ...
0
votes
2answers
75 views

Movement nudge instead of constant

I am making a small game where the player is constantly moving upwards, and I am having slight problems with the movement to the sides. The script located under works quite perfectly in itself, but my ...
2
votes
1answer
110 views

Get object length and width divided by two?

I have googled and found a script for the following task; Make the camera move to touched position. However, this script will jump to x and y positions on an object, while i would like for it to move ...
-1
votes
1answer
124 views

Unity 3D: Raycasting for gun hits

I am having trouble understanding raycast hits in Unity3D. I am trying to create an FPS game, so I have a gun, bullets and so on. My script for the bullets is: var Bullet : Transform; var Spawn ...
0
votes
1answer
86 views

Camera Touch Zoom and Pan with world - 2D

I am doing my first unity2d game and im in need of a little optimization for my camera. I have a camera which could pan and zoom with the speed i have defined. The problem with that is the speed i ...
0
votes
1answer
63 views

Raycast doesn't point on the right direction

The raycast line im rendering is acting weird, it doesn't point where I want it to. I want it to point from the yellow object to the selected one but it draws it at another position. Here is my ...
0
votes
1answer
45 views

Variable Variables in unity using JavaScript?

I'm working on a custom built save system for a project a friend an myself are working on. Currently all variables that are saved to file, are stored as static variables in a global variables script ...
-1
votes
2answers
69 views

Unity - Can't Shoot While Moving

Shooting does nothing while moving, but it works perfectly fine while standing still in my Unity project. As far as I can tell no one else has this problem. I just used the Character Controller first ...
0
votes
3answers
149 views

Do I need to learn any physics if I use a physics engine? [closed]

Complete novice out here. Of course I know basic physics like mass and inertia. I don't want to make an engine I just want to make a game and use a physics engine made by someone else. Do I need to ...
0
votes
0answers
97 views

How to overlay texture materials on top of each other in Unity 2D tiled game

I'm learning how to do a 2D tile-based game. So far, I have followed this tutorial which seems like a good starting point. With his method of building the raw triangles and then applying the uvs, I ...
0
votes
0answers
71 views

How to determine velocity from force

I recently started a project with the intention to master the physics aspect of Unity. Although I have a good knowledge of Unity, I never had the opportunity to work on game that makes extensive use ...
0
votes
3answers
132 views

Calculating the bounding box of a game object based on its children

2D game with Unity. Have a parent game object, with several children objects scattered all over the scene. I want to calculate the bounding rectangle of the parent game object. Let the black dots be ...
0
votes
2answers
80 views

Scaling a GameObject for a progress bar representation

I am trying to implement a progress bar system for my game. I know that it could be done with Unity's OnGUI and scaling with width of the texture but I don't want it to be a GUI element because in my ...
0
votes
1answer
49 views

Set a component on root gameobject for working all the children

I have a enemy which has ragdoll. So it has a few child object and each child has own collider. I dont want to add script for every child for just OnCollisionEnter function. All of them will work ...
4
votes
1answer
436 views

Consume input events in Unity 4.6

How do I consume the input events in the new 4.6 unity gui system? If I click on a button for instance I don't want anything else non GUI related that might be listening for mouse input to react to ...
1
vote
2answers
112 views

Does Unity load the texture data of all the sprites in a sprite array property?

using UnityEngine; using System.Collections; public class Test : MonoBehaviour { public Sprite[] mySprites; } From the editor, you can put sprites in the array property. I want to put ...
0
votes
0answers
27 views

How to detect which side of a collider has been hit in Unity? [duplicate]

I have seen this question asked many times and I even asked this question before but I didn't understand the answers(I am very new to Unity). So I am developing a game and so far I have a wall you can ...
-1
votes
2answers
83 views

Execute native ios code in unity

I want to execute native iOS code in unity. For this I have added two files in /plugins/ios. ViewController.h ViewController.m Code for each file represented as under. ViewController.h ...
0
votes
0answers
55 views

Breakout Clone: Ball isn't bouncing as expected

So I'm working on a Breakout Clone using Unity 2D Physics only, and I'm having some trouble with the bouncing effect. Every object in my Scene has a Bounciness of 1. First, this is the code of my ...
4
votes
3answers
266 views

How to generate a “loop room” in a platformer game (by Unity)?

I want to build a level with a room whose left edge is linked to right edge in a 2D platformer game in Unity. My goal is let all objects disappear in one side will appear in other side of the room. ...
0
votes
1answer
77 views

Building a unity game without textures? [closed]

For a school project I have to build a unity game. Since the focus is on programming and building the game and not on creating graphics (we are supposed to find free models/textures online) I'm trying ...
0
votes
1answer
184 views

How to lock aspect ratio when resizing game window in unity?

I want a scalable game window that when resized stays at 16:9 aspect ratio. The goal is for the user to be able grab the window on the right or bottom and resize it. The game should adjust the ...
3
votes
2answers
288 views

How to approach a coloring app?

I want to make a coloring app in unity. I don't need flood filling. THe player will select a color and click the shape to fill that color. The app will have designs as shown below: Here the problem ...
1
vote
0answers
66 views

Aligning a gameObject to position and normal of another gameObject inside Unity

So I am instantiating a GameObject (the one with cities and trees in the image below) and trying to align it to a hex tiles on a Sphere. So after I instantiate the gameObject, I ray-cast to get it ...
0
votes
1answer
42 views

Using RPC's for movement of an object across a network [closed]

I've been building upon http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php At the moment when I spawn a sphere on the server it spawns on the ...
0
votes
0answers
68 views

Unity How to stop a jump?

transform.Translate(Vector3(horizontal * speed * Time.deltaTime, vertical * speed * Time.deltaTime ,0)); Im new to unity and Im asking how to stop a jumping, cause if I turn on this script on char ...
0
votes
1answer
81 views

How to make an object that has no rigidbody2d component smoothly fall on the ground in Unty2d?

I have two character in my game: enemy and main character. Enemy can throw different objects into the main character. For this moment i am doing this action in such way: void FixedUpdate(){ if ...
0
votes
4answers
153 views

When would a mesh collider be better than primitive colliders

I have been reading through the Unity Manual and have come across some interesting information about mesh colliders and primitive colliders. It got me wondering if using many primitive colliders would ...
0
votes
1answer
137 views

Finding next AI move using MinMax algorithm for Checkers [duplicate]

I am currently working on a Checkers game using Unity ( human vs computer ) I am done with the base architecture of the game ie defining the rules, moves, jumps etc. I am currently stuck in ...
2
votes
1answer
186 views

Method Animator.SetBool sometimes is not working (or not triggering) in Unity2D

I have trouble with Animator in Unity2d. I have a main character for my game. The character has his own animation clip for fighting. When the player touches the screen, i am starting animation. When ...
0
votes
2answers
115 views

How unity works on Web

How Unity can work on Web if the code is written in C#? I understand that you can compile the C# code to a shared library and use it in Java (for Android) in ObjectiveC (for iOS) to enable Unity on ...
1
vote
1answer
162 views

Draw Primitives with Unity 2D

I would like to be able to draw primitives in unity 2d to define my game objects. I have tried the following example: using UnityEngine; using System.Collections; public class ExampleClass : ...
0
votes
1answer
61 views

Spawning a Sphere and trying to move it [closed]

I've been trying to build upon a blog post on Gamasutra http://www.gamasutra.com/blogs/DarrelCusey/20130221/187128/Unity_Networking_Sample_Using_One_NetworkView.php In this I would like to spawn a ...
3
votes
1answer
163 views

How do you make specific collisions in Unity?

So I have created a "game" where you are automatically running across platforms and you can jump and land on the top of them. I want to set it where if you collide with the the left and right side of ...
0
votes
1answer
170 views

How to make the damage inflicted to the enemy and the main character more unpredictable

I am developing a small mobile game. The enemy can damage my player by throwing objects at his side, and the player can damage the enemy by hitting him with a bat. For the moment, I am calculating ...
-1
votes
2answers
59 views

Collisions are not working in Unity [closed]

For some reason my collisions are not working. This is what the code I have. void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.tag == "wall") Debug.Log ("It worked"); } When my ...
0
votes
0answers
45 views

How to play only a part of animation in Unity 2D?

I want to make a progress bar in my game for show the amount of collected item in my game. I designed a animated sprite sheet from empty amount to full amount of the progress bar. My Question is: ...
-1
votes
1answer
51 views

How to temporarily disable input?

I have made a jump script and I want all input to be ignored when you are in mid air (so that way you don't have infinate jumps). How to do this?
0
votes
1answer
123 views

Sending RPC calls from server to client inside Unity

In my game inside Unity, I have two scenes setup. One for the main server ( acts like authoritative server ) and the other scene for my client. The game starts once my client connects to the server. ...
1
vote
2answers
136 views

How do I create the visual effect of transitioning between night and day?

I am making an open-world project in Unity 4.5.5 and I want to create a visual effect of transitioning from day to night? The Legend of Zelda: Wind Waker HD has a great example of such a transition. ...
0
votes
2answers
312 views

How do I have a camera follow my object in Unity?

I have an object that automatically moves by itself and I want the main camera to automatically follow it.(Like in games such as geometry dash and jetpack joyride) This is the code for the automatic ...
0
votes
0answers
45 views

Passing random number parameter to RPC call inside Unity

So I have posted a similar question previously but this is more specific to actual code that I am trying to implement for a multiplayer game that I am working on for IPAD. In short, this will be a ...
0
votes
0answers
38 views

Rewriting the existing code for RPC in Unity

So I am basically done making a game inside Unity. The next phase is for me to make the game run on different IPAD devices ( max 4 ). So the main game would run from a PC which would act as a server ...
0
votes
2answers
90 views

c# Unity - Matrix output incorrect on vector rotation

I have a input Vector (1,1,0) when I run it through a Unity Matrix4x4 class with a rotation of 90 degrees around the Z axis the output is (-0.9999999,1,0) which is nearly correct but strange. But ...
1
vote
1answer
140 views

How to animate clouds [closed]

I am creating an open-world in Unity 4.5.5 and I do not know how to make the clouds move. This video of The Legend of Zelda: Wind Waker HD is a perfect example of the clouds moving in the sky. How can ...
0
votes
1answer
108 views

How can I allow players to draw decals for their avatar and items?

I want the player to be able to draw a simple symbol, even if it's pixelated black or white, that their character can have on their weapons, armour, forehead or even markers and monuments. How would I ...
3
votes
1answer
131 views

How to mirror flip animation curves in Unity?

I have a animation that moves my camera from left to right. Now I'd like to copy it with 'mirror' transformation so I can use it to move from right to left. Is it possible to do it using script or ...
0
votes
0answers
30 views

How can I use different fonts for different objects in Unity?

In Unity 3.5, I have a font that is strangely linked to four game objects. I want to put separate fonts on each object. In the Inspector, when I click on the circle icon next to the "Text" ...
0
votes
1answer
44 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
78 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 ...