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
182 views

Should I use inheritance or interfaces for an inventory system? [closed]

I'm about to start programmin an inventory, harvest and loot system. I will need enemies that drop items, harvestable environmentals that yield resources and an inventory system that takes items and ...
8
votes
2answers
2k views

How can I prevent rigid bodies from moving through each other using Unity's built-in physics?

I'm trying to create a game where objects can be dragged, but I'm having trouble with the physics. With rigid bodies that have similar masses, they sometimes push through each other when dragged and ...
1
vote
1answer
2k views

GUIText size on 4:3 and 16:9 is different

I have a text (guiText) on the screen. It shows correctly when viewed on 16:9 resolution. But it scales up when viewed on 4:3 (e.g iPhone4). I am using following ObjectLabel script to place it on ...
0
votes
0answers
27 views

Creating a dynamic map in Unity [duplicate]

I'm currently working on a small strategy game that involves online multiplayer. I was now planning to add a sort of 'Empire' map to my game. That is, a (3D?) map of different lands, similar to this: ...
0
votes
0answers
171 views

Exporting Motionbuilder mocap data to Unity best practice

I've discovered what I think is the most efficient way to get mocap data into Unity 4.3.4f and was wondering if there was a better/more efficient way. Essentially i'm pulling in the raw BVH data into ...
2
votes
2answers
1k views

Retrieve the original prefab from a game object

How would one proceed to retrieve the original prefab used for instantiating an object? In the editor these two functions work : Debug.Log(PrefabUtility.GetPrefabParent(gameObject)); ...
1
vote
3answers
166 views

Unity, Cannot See Items on the Scene

I am new to unity. I have created an asset by using Blender and managed to put it in the scene. But somehow now I can only see one item at a scene. For example I can only see camera when I clicked ...
0
votes
0answers
151 views

Sprite Rendering Cost Calculation

First of all asking before asking this question I have already read following post for the clearance of my mind. Sprite Renderer Texture 2D I want to change my background texture as per device ...
1
vote
1answer
138 views

Slow Update to improve performance?

For my enemy AI, I only need decision making to be done every second or every half second. Would it make a meaningful difference if I didn't run the analyzing method in the Update, but rather invoked ...
0
votes
0answers
144 views

Dynamic load and unload material

For targeting multiple display resolution, I focus on using MultiPlatform Toolkit usage. In which I found following statement in tutorial section for dynamically handling materials. "Just remember ...
2
votes
1answer
184 views

When one should use events in Unity and how they impact performance?

let's say that inside an OnGUI() script we want to call a method from another script to handle a particular situation. From a prestational point of view, what's the difference between these 3 ...
0
votes
0answers
157 views

Run a few seconds of simulation just after loading a scene

I'm looking for a way to execute 3 to 15 seconds of simulation once a scene is loaded. The problem is: some objects can be left suspended in motion while the player exits the scene. their state is ...
2
votes
0answers
114 views

Design Question, Thoughts on Path Finding for a Galaxy Map [closed]

I am thinking through solutions for a galaxy map. We have different solar systems that need to be connected. I do think a-star (A*) is possibly a good solution but was curious if it was really the ...
0
votes
1answer
703 views

How to clamp player movement correctly?

I have a 2D space shooter game. I looked up some questions from unity community and came across this solution. Below is the code for my player's movement: //horizontal <- || -horizontal -> ...
-2
votes
1answer
171 views

How to know the relative facing angles between two players? [closed]

I want a grappling system similar to Tekken, in which different grapples animations are performed depending on which side of the opponent the player performing the grapple is facing. For example, ...
1
vote
0answers
100 views

Player glitches through floor? [closed]

I'm making a 2D platformer in Unity, and everything is going pretty smooth, accept I can't figure out why my player is glitching through the floor, the player will collide for a few seconds while ...
0
votes
1answer
276 views

Destroying non-monobehaviour derived classes

I'm building an inventory system with different items classes deriving from a 'Item' base class. When an inventory slot runs out of the item it holds I want the item to be destroyed. I cannot null ...
1
vote
1answer
305 views

Rotating a GameObject around its center

I'm trying to rotate a GameObject that consists of several cubes around its center of gravity on an axis. When using transform.Rotate(), it rotates around its pivot point (as shown in picture 1) and ...
0
votes
1answer
3k views

Switch character to play animation() in Unity3D using c# [closed]

I have two or more 2D character (Character A, B, n..). I made an animation on the character using the Animator class "AnimCharacter.cs". if i press the 'PgUp' character 'A' can call the function ...
1
vote
4answers
719 views

Get GameObject to bounce of colliders [duplicate]

I am making a Atari Breakout game with unitys 2d tools and I need to get the ball to bounce of colliders in the scene. If you havent played the game before how it works is if the ball hits the wall at ...
0
votes
1answer
476 views

Problems implementing a 3rd person static camera in Unity3d

I am building a space game that I would like to be controlled in third person. Basically I would like the camera and the ship to remain tied together and remain the same distance from each other but ...
1
vote
1answer
366 views

Unity seperation of prefabs with two dimensional terrain generation

I have the following function: public void Spawn () { GameObject g = ((GameObject)Instantiate (hills [Random.Range (0, hills.Length)], new Vector3 (0.0f, ...
2
votes
1answer
755 views

Create sprite renderer using custom material

I have done following thing. Create Material Attach sprite with texture type as Texture Add sprite renderer component to game object Assign material to it that I create in last steps There is no ...
1
vote
0answers
287 views

Is there an up-to-date Sublime Text 3 package for Unity3D C# completions and snippets? [closed]

I found a couple on wbond, but the only one that's been more or less recently updated has less than 1K installs. Does anyone have experience with Sublime 3 and Unity? I'm mostly interested in 2D ...
1
vote
1answer
234 views

Depth write and depth test in Unity

Scenario: several objects (o1, o2,.., on) have to be rendered with the z test disable, but the z values must be written to the depth buffer. In another pass, some other objects (t1, t2,..., tm) need ...
0
votes
1answer
251 views

Using Appendbuffers in unity for terrain generation

Like many others I figured I would try and make the most of the monster processing power of the GPU but I'm having trouble getting the basics in place. CPU code: using UnityEngine; using ...
2
votes
3answers
1k views

Polygons vs sprites rendering performance in Unity for windows phone 8

I'm currently building a windows phone 8 game with unity, having 111 (no more no less) sprites being updated each frames. I have a strong overhead in the profiler (70% to 90% minimum) I tried the ...
0
votes
1answer
152 views

Create texture the size of my mesh

I programmatically create a Mesh and want to generate a texture that patches coloured squares together so that the patchwork perfectly matches the vertices. The mesh's dimensions are expressed in ...
1
vote
1answer
1k views

Moving rigidbody2d towards mouse click using AddForce

I cant get my rigidbody2d game object to move to where i click the mouse. The first click works. The object travels to the mouse click and stops. But the second time (or the third time) i click the ...
-1
votes
2answers
166 views

Unity score on touch adding up incorrectly

I'm currently working on a game where a user can click an object and this should increase their scored by 1. Unfortunately it seems to be increasing it by more than 1 sometimes and I can't figure out ...
1
vote
0answers
949 views

How can I get this Shader for Unity working with Normal maps? [closed]

So I'm by no mean a shader coder, but I've been hacking around the last few days trying to get working a shader for the sprites of the skeletal animation tool Spine in Unity that can properly use ...
-1
votes
1answer
157 views

lerp z rotation towards mousepointer

I am trying to get transform.rotation.z to chase the mouse pointer at a rotation speed. But I get a very weird results and can't figure out what I am doing wrong. var mp = Input.mousePosition; ...
-2
votes
1answer
182 views

Lerp speed or lerp time [closed]

Am I right about the fact that lerping can be done over a set period of time or at a speed which will continue until the target is reached? How are the formulas for the two? Is it something like ...
1
vote
1answer
288 views

Strange collision behaviour in 2D game even though the collision is very basic [closed]

I have a player ship (cube) and some enemy laser projectiles. When the player ship has position X values greater than 1, collision with the enemy projectiles occur but when it has lower X values, the ...
-1
votes
1answer
265 views

Match-3 “find matches” function not returning correctly

So I'm in the process of making a simple bejeweled clone and for some reason my "find matches" function is having problems. I've broken it up so it check horizontally, then vertically and right now ...
7
votes
3answers
443 views

How can I keep two racing players synchronised?

I am working on a Unity mobile game, much like a multiplayer version of Temple Run. I'm seeing a fluctuating network latency (generally 200-500ms) because of the mobile platform. The two player ...
-1
votes
1answer
97 views

Lerping back and forth in Coroutine [closed]

Im trying to lerp the scale of a game objecto to 30% its size and then back again, but all i get as output is " Blippping Cursor up scale 0 down scale 0 IEnumerator Blip_cr ...
0
votes
0answers
48 views

Memory Management on Physic Body Frames in Unity

Compared from the Android programming with the help of LibGDX and Eclipse programming software in making 2D physics based game from this previous question, what if I'm throwing lots of game objects ...
3
votes
1answer
514 views

Unity Spaceship camera control

I'm trying to make a third person spaceship control system in Unity. In theory, it works like this: Let's suppose you move your mouse to the right. The targeted direction would rotate to the right ...
3
votes
1answer
2k views

Moving a character according to the animation, rather than code

I'm using 3ds Max to export character animations in which my character is moving. I expected this to mean that the character will move in Unity, but it doesn't... For example, if my animation (in 3ds ...
3
votes
1answer
696 views

Issue with interpolation on a burn shader (lerp and smoothstep)

I'm trying to create a simple burn shader. See here for more info on the method I'm using. However, I don't get why replacing the smoothstep with a lerp results in completely different results. Am I ...
1
vote
1answer
362 views

How do I create indoor scene lighting? [closed]

I'm building the inside of a space ship in Unity as POC. I need info on scene lighting. Rooms, corridors or just in general how to make an enclosed scene look great with lights. Keep in mind this is ...
1
vote
0answers
59 views

Weird floor blur close to camera [closed]

So simple question I guess. I created a floor with texture and when I fly with the camera there is the strangest blur in front. Almost like a circle surrounding the camera looks fine and then a line ...
0
votes
0answers
95 views

Unity Mecanim Glitch

I am used to using the old animation, but I wanted to start using Mecanim. Here is an image of a creature I modeled with some animations, in blender, in my unity scene: And here is the blend import ...
0
votes
1answer
121 views

How do I change the size and specific height values of Unity generated terrain?

I'm having problems with terrain scripting while trying to do a infinite-world with Unity's terrain generation. How do I change the terrain height at specific points? And how do I set the amount of ...
1
vote
1answer
65 views

Loading source controlled MonoDevelop project leaves out some folders

I have recently started using version control in MonoDevelop and have discovered that if I include a folder containing for example Scenes that they will be included when I push changes to master. My ...
2
votes
1answer
152 views

At same positioned game objects collision detection

In my game, I am creating two game objects at same position using Instantiate statement. Each generated object has box collider attached. So I want to detect collision between them so I write ...
3
votes
2answers
781 views

Recommend a way to draw thousands of particles (liquid) per frame in Unity3d

I'm writing a plugin for this library for Unity3d. I have it working and now I am looking for an efficient way to draw the particles. My 1st test just uses sprites and runs fine on my laptop but I ...
0
votes
1answer
712 views

Slope polygon collider 2D causing box collider 2D to 'bump' while sliding on it

I'm doing procedural terrain generation. So far I've created the mesh, and attached a 2D polygon collider to it. The terrain is made up of hills going up and down. After doing so, I put a 2D rigid ...
4
votes
1answer
796 views

Problem getting information about running processes with .GetProcesses() in Unity3D on OS X

I was going to ask this on Unity Answers, but I keep getting an error when trying to get to the site so thought maybe you guys could help. I've also tried the Unity3d subreddit and didn't manage to ...