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
0answers
57 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
102 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
90 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
32 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
94 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
62 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
64 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
214 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
48 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
93 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
147 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
106 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
46 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
128 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
72 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 ...
1
vote
2answers
118 views

Locking frame rate to 60 in the editor

My game runs at several hundred frames per second. I want to limit it to 60. So I used Application.targetFrameRate = 60; This works on the iPhone. But in the editor it only reduced the frame ...
1
vote
2answers
80 views

Should I use textures that are the size of the object?

I've been reading but couldn't find an answer to my question: If I have an object, let's say 30x30. Should I use a texture that is 30x30, 300x300, or even 3000x3000 or should I follow 'the powers of ...
0
votes
0answers
21 views

get vector of enemies that facing player [duplicate]

if I have player location (4,6,-3), thee y- axis is vertical and I have enemies at (7, 6, 12), (16,6,11) and (11,6,1) how to calculate the vector of each enemies that is needed to face the player? how ...
1
vote
2answers
183 views

How should I store edge weights in my A* graph in C#?

I am working on A* pathfinding in Unity, using C#. I am currently implementing Dijkstra's shortest path algorithm. I have a Dictionary with nodes as keys and corresponding lists of adjacent neighbors ...
0
votes
2answers
81 views

Destroy GameObject as an Array of Transform instantiated destroying the whole array

I am trying to destroy a GameObject with the Destroy() method, but when I call it the whole array is destroyed, not just that element. //Instantiating the prefabs public Transform[] blue; foreach ...
2
votes
2answers
251 views

Detecting mouse clicks in Unity UI Beta

I want my game script to detect mouse clicks everywhere on my screen, except one corner where I have a pair of buttons to control the sound and will be handled separately. To help identify this ...
2
votes
1answer
217 views

Sending POST data with WWW in Unity C#

I would like to use Unity's WWW class to send a an HTTP request with POST data. So in my server, my PHP script can do something like $number = $_POST["NUMBER"]; According to ...
0
votes
2answers
130 views

Explaining vector math for a pendulum camera

I came across a code that I guess is doing a pendulum camera, that's the class name. I would like to know the math behind that. I would like also to know how to decipher those stuff in game math, ...
0
votes
1answer
55 views

Trigger an event when a game object touches a non-solid game object

For a 2d game, I are currently making an AI and I want it to jump when it touches a invisible cube, which isn't solid, how do I do this?
14
votes
3answers
2k views

How can I create a stretchy, breakable pizza cheese material?

I want to create realistic pizza and allow user interact with it. What I want: What I created: I created model of the pizza (8 pieces) in Blender, then imported it into Unity. The piece of ...
3
votes
2answers
248 views

How to design a drag and drop inventory system with transition from icons to game objects?

I’m trying to write a simple 2D game in Unity with an inventory where the user can drag and drop different objects on the screen. I need the inventory to contain icons which on drag will become ...
1
vote
1answer
86 views

Collision detection across multiple components

I have been reading this article: http://gameprogrammingpatterns.com/component.html which describes how a game object should be constructed out of components. It also encourages the decoupling of ...
4
votes
3answers
478 views

How do I procedurally animate a cell eating another cell?

The entities in my game are soft-body, amorphous cells. I'd like to create an animation where enemies are engulfed by the player's cell. That is, I want to generate a "cell eating another ...
1
vote
1answer
76 views

Night cycle on a globe

I am working on a tile based game on a globe. I am trying to implement a simple day night cycle on my hex globe something similar to the image below Here is the picture of my globe inside Unity ...
0
votes
1answer
136 views

Unity 2D detect if swipe goes through an object

I am developing a game in unity with flying arrows that the user tries to deflect by swiping through them (changing their direction). I can get the arrows to move with the swipes, but they move no ...
1
vote
1answer
121 views

Prefab disables its script when a clone is instantiated

A clone of a cube is spawned when it is destroyed, however the clones disable the script in the editor (example: http://gfycat.com/SnarlingScornfulEgg). Used the exact same script for a different kind ...
0
votes
1answer
167 views

Unity3d wheelcollider falling through terrain

I have created simple project with 3D car and terrain. I have added 4 Wheel Colliders on model wheels. But when I run project wheels falling through terrain. Before run: After run: I am sure that ...
1
vote
2answers
305 views

Position GUI Text in 2D game

I am working on a 2D game, and my camera is a orthographic with a size of 320. I want to display some text, but not with OnGUI(). Rather, with a GUI Text game object. I couldn't help but notice that ...
2
votes
1answer
83 views

How do I change the material of an object with Script in Unity?

I was making a game with Unity and I want to change an object's material using JavaScript when the player collects 5 collectables that I made. The collectables get stored in an int variable called ...
2
votes
1answer
64 views

How do I save variables and load them in Unity with JavaScript?

I made a game and i want to save the high score and load it back. I need to save 3 variables and load them when the game starts. How do i do it?
0
votes
1answer
63 views

View Rigidbody 2D Wire Frame

Simple question. When I prototype game ideas I like to create objects without having to attach sprites. Is it possible to create a Rigidbody 2D in unity, set its size and render its wire frame? I am ...
0
votes
1answer
95 views

Save player data in Unity 3D [closed]

I've started to design a commercial Client/Server game in Unity and I need server-side saves players data for later analysis and web consultation (like battle.net). Is there a best practice to achieve ...
1
vote
1answer
91 views

How do I use elapsed time as the player's score in Unity?

I'm making a "survival" game, where the goal is to stay on a rotating board as long as possible. I want to add a score system based on how many seconds passed. For example, if you stay on the board ...
0
votes
1answer
136 views

Unity3D: Change Background Image on a GUI Skin

So I'm testing with GUI Skins and trying to make something cool, and I want to change the background image of the application background. This is what I mean In the screenshot above, the background ...
1
vote
0answers
12 views

Unity3D: Rendering images weirdly in GUISkin

So i'm trying to make a gui skin in Unity3D and i'm having some problems with the images, what I mean is the images are being rendered all weirdly, not properly and some have lines through them. I ...
2
votes
1answer
99 views

Saving Game Data In Windows Store App

I am creating a windows store game using unity . I want to save the current high score data . I most probably use StreamReader / StreamWriter for saving data but when i build the executable for ...
0
votes
2answers
79 views

Getting neighbors of hex tiles in 3D space

I have a hex tiled model like attached below. Each of the hex tiles are separate objects meaning I can access each of the hex tiles individually inside Unity Now in my program I want to be able to ...
1
vote
2answers
94 views

Fastest way to assign sprites to components in Unity

I'm using a sprite atlas and Unity's built-in sprite editor to tease out the individual images. Specifically, I have a single texture containing lots and lots of icons for armor, and I am assigning ...
0
votes
0answers
62 views

Render text on a Quad

I have created a quad with a single color that's rendered on screen as a square, which is fine. I want to add some text to it (or slightly in front of it) that says "Hello". It sounds from reading ...
1
vote
1answer
193 views

How to save a Unity prefab on file?

I'm working on a Unity project, and what I'm doing is creating a new scene. In my new scene, I want add some prefabs that there aren't in the project folders, but I can see them in another scene. So ...
2
votes
0answers
71 views

Transparent diffuse fails to render from all viewing angles

I'm rendering this chunk as a Unity mesh and I have just one material (with alpha) which is applied over all the mesh. Everything in the chunk is automatically generated at runtime, so it's not ...
2
votes
1answer
75 views

Lidgren peer to peer

I am currently integrating Lidgren into my Unity game. I need to move away from the built in networking capability in Unity because of the style of game I am making, basically MMO, I will have far too ...