Questions tagged [unity]

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.

Filter by
Sorted by
Tagged with
14
votes
7answers
35k views

How to change Gravity towards certain object in Unity?

I have two spheres in Unity. One is 1000x in size other is 1x in size. So I want the smaller sphere to be attracted to bigger sphere. So how do I do it. I know that it can be down through gravity ...
14
votes
3answers
4k views

Unity - How to move a ship realistically to a point in a 2D top-down game

i'm trying to move a sailing ship to the point where i clicked with the mouse. this movement should be realistic (oar at the back where the ship moves around) so if the mouse click is left and in ...
14
votes
3answers
3k views

The reasons behind Unity3D engine design (game object/transform component)

I'm trying to understand the reasoning behind Unity3D engine design and this is something I can't get my head around yet: why is transform data stored in a separate component, instead of being a part ...
14
votes
5answers
31k views

Ignore collisions with some objects in certain contexts

I'm making a racing game with cars in Unity. The car has a boost/nitro powerup. While boosting, I wouldn't want to be deviated when colliding with zombies, but I do want to be deviated when colliding ...
14
votes
2answers
4k views

Why are trees shining in background?

Currently I am creating a forest scene in the dark, and the trees are shining far away, but when I get close they are fine. I have the shaders set to "Nature/Tree Soft Occlusion [bark/leaves]", but ...
14
votes
0answers
7k views

Creating Rope Physics for Unity [closed]

I want to create a bungee jumping-like game in Unity and therefore I need a rope physics. I especially need elastic ropes with capability to pull objects with velocity after a little extension. Do you ...
13
votes
3answers
11k views

Unity coroutine vs threads

Whats the difference between a coroutine and a thread? Are there any advantages of using one over the other?
13
votes
2answers
6k views

Movement appears to be frame rate dependent, despite use of Time.deltaTime

I have the following code to calculate the translation required to move a game object in Unity, which is called in LateUpdate. From what I understand, my use of <...
13
votes
3answers
21k views

How to get all tiles from a Tilemap?

I have been trying a little bit the new TileMap system in Unity and I was looking for a way to access the tiles as a List or 2D array but I can't find anything ...
13
votes
2answers
3k views

How to make my 2D character stand normally on slope?

I've got this character in Unity3D (2D Mode)... in a a slope which looks like this, But I want the character to stand along the red line..Like below How can I make it in Unity3d? I've got this ...
13
votes
3answers
12k views

How do C# and UnityScript differ in Unity development? [closed]

Other than the obvious language differences, how do UnityScript and C# differ when developing games in Unity3D? Is there a noticable performance difference? Is the UnityScript code packaged as-is? If ...
13
votes
2answers
957 views

File operation(s) failure on game crash/kill by OS/User in Android

My game saves its state after fixed interval on a file in game/app internal storage. When my game is killed or crashed by user or OS respectively, We write current game state on that file. File ...
13
votes
1answer
15k views

When to use a blend tree vs state machine for animation

Im an experienced game dev hobbiest making my first game with 3d animated characters (in Unity) and am struggling to figure out when to use blend trees vs animation state machines. I understand both ...
13
votes
5answers
17k views

How do I create a toggle button in Unity Inspector?

I want to create a tool similar to Unity's Terrain tool, which has some nice toggle buttons in the inspector: How can I achieve similar design to this? I know how to create normal buttons and other ...
13
votes
3answers
2k views

Does Unity have existing support for Timelines?

I am planning the development of a game in Unity3D, and trying to come to terms with what the engine has already provided, and what I must code myself. The game itself is going to be a rhythm game, ...
13
votes
2answers
14k views

Why does Unity let you install iOS Build Support on Windows?

When installing Unity on a Windows machine, you are allowed to select "iOS Build Support" as one of the components to install. However, it is not possible to make an iOS build from Windows. Why is ...
13
votes
5answers
30k views

How can I draw an outline in Unity3d?

I am trying to highlight a rectangle of arbitrary height. I thought the easiest way to do this would be to create a separate "box" gameobject that outlines the rectangle. I've tried with both a ...
13
votes
3answers
3k views

How can I do unit testing in Unity? [closed]

How to implement Unit Test at Unity3D. I wonder if it would be possible to extend the Unity editor to have some sort of testing framework in it. Is there any guideline to implement it? Any ...
13
votes
1answer
12k views

How do I programmatically access single sprites when Sprite Mode is Multiple?

Unity 4.3 newly brings an ability to cut up a sprite sheet into multiple individual sprites. This is useful since you then only need one master spritesheet, but nevertheless get references to ...
13
votes
1answer
846 views

How can I make outline shader like “Life is Strange”?

I want to make sketch shader like life strange. shader has two part: 1.animated dashed line 2.noisy outline I like to know how can I make noisy outline? see outline of objects First I tried to ...
13
votes
1answer
2k views

how to automate the game testing?

I am new into this field of testing. I just developed a basic game using unity engine but i want to test it. I have checked with selenium but i don't know how to get the value that is being returned ...
12
votes
5answers
3k views

How to determine if character has fallen into the gap in an infinite runner/jumper?

I'm building a 2D infinite runner. In the game, character jumps from pillar to pillar and pillars are randomly generated. I have this working. But how to determine if the character failed to jump on ...
12
votes
4answers
10k views

How to solve the ground check problem?

I noticed a problem in Unity's third person controller's ground check. The ground check should detect whether or not the player is standing on the ground. It does so by sending out a ray beneath the ...
12
votes
2answers
5k views

Why does Unity use reflection to get the update method?

Why does Unity use reflection in order to access MonoBehaviour message methods like Awake, ...
12
votes
6answers
22k views

Unreal Engine 3 vs id Tech 3 vs Unity [closed]

I'm trying to decide which engine I should start using to try to start building a game in. I had chosen Unity, but upon hearing that Unreal Engine 3 had just become kinda free to use, I found myself ...
12
votes
6answers
23k views

How to Color.Lerp between multiple colors?

I have found it rather difficult to find a solution to this in the Unity documents. Color.Lerp(Color a, Color b, float t) is a function that gradually changes a ...
12
votes
5answers
34k views

Unity: how to detect collision occuring on child object, from a parent script?

I've an enemy, with this structure Enemy Body Head Arm Left Arm right And so on. I also have a collider for each part of the body. In my "Enemy" object I've attached a script and in that script ...
12
votes
4answers
55k views

Glass Material for Unity 5

Anyone know how to make a glass material in Unity 5? I can do metal and image textures, but not sure how to create a glass material. A search on Google would not get me anything for Unity 5 so it ...
12
votes
3answers
4k views

Why use Time.deltaTime in Lerping functions?

To my understanding, a Lerp function interpolates between two values (a and b) using a third value (...
12
votes
3answers
3k views

How should I implement units' enemy “awareness”?

I'm using Unity3d to develop a RTS/TD hybrid prototype game. What is the best approach for "awareness" between units and their enemies? Is it sane to have every unit check the distance to every enemy ...
12
votes
3answers
90k views

Does Unity let you code in Java? [closed]

I am fairly new to Unity3D experience , but I have a very good knowledge of Java and Android development. I am really confused that if Java is at all needed for developing android applications? I read ...
12
votes
4answers
10k views

How can I create light shafts like Journey's in Unity?

I'd like to create cartoon looking sun / light shafts that look very close (or identical) to the ones in very well known and loved games like Journey: and Ori: How can I accomplish this?
12
votes
1answer
6k views

Why doesn't Unity's OnCollisionEnter give me surface normals, and what's the most reliable way to get them?

Unity's on collision event gives you a Collision object that gives you some information about the collision that happened (including a list of ContactPoints with hit normals). But what you don't get ...
12
votes
1answer
3k views

Creating a Robust Item System

My aim is to create a modular / as generic as possible item system which could handle things like: Upgradeable Items (+6 Katana) Stat Modifiers(+15 dexterity) Item Modifiers(%X chance to do Y damage, ...
12
votes
2answers
9k views

How can I get voice recognition features into the Unity Game Engine? [closed]

How can I get voice recognition features into the Unity Game Engine? Is there a plug-in or a framework (hopefully freeware) that I could use? If so, do you have any ideas on how to install it? Also, ...
12
votes
1answer
489 views

Dynamic model interactions

I am just curious as to how in many games (namely games like arkham asylum/city, manhunt, hitman) do they make it so that your character can "grab" a character in front of you and do stuff to them. I ...
12
votes
1answer
2k views

Shader to see silhouette through alpha blended sprites

I want to achieve in Unity a see through effect like the one in these examples: In my specific scenario there are a couple of requirements: Sprites are using alpha blending, and sprites have ...
12
votes
1answer
812 views

How can I stop Substance's runtime texture caching?

Procedural textures with the Substance Engine seem to update very quickly if you turn off caching, modify one exposed variable at a time, modify it frequently, and even then only after you've ...
12
votes
1answer
540 views

Oculus Rift on Motion Simulator Platform

I currently develop a VR environment for an existing (physically) large motion simulator platform. The user can sit on this motion platform and gets accelerated and tilted to induce the feeling of ...
12
votes
2answers
1k views

How can I visually see changes made to a scene since the last git commit

I'd like to see the changes made in a scene (.unity file) before I commit them to git. I have looked into several GIT/Unity solutions but all of them are made for merging changes and not for showing ...
11
votes
4answers
4k views

How can I implement an inventory that stores different types of items?

Let’s assume I want to create an RPG with collectible items my character can pick up and store in his inventory. One item could be a sword, with an attack, defense, and level attributes. Another ...
11
votes
2answers
4k views

Why is it that I’m still able to call a coroutine from another script, even though I marked it as private?

I have this private coroutine in my WinDialogue script: ...
11
votes
2answers
3k views

How to make a delayed mouse input?

I have a car game and the idea is that the player is drunk. I want to have a delayed input from the mouse, where you move the mouse side to side to turn. How can I setup a constant delay between the ...
11
votes
2answers
3k views

Which of these two codes are 'better'? Making a local variable or a class variable?

Im making more games and asking more stupid questions. Hopefully this one is very brief. I'm making a very basic class which just moves a Player object by applying force to a rigidbody, but it got me ...
11
votes
5answers
1k views

What file types should I exclude from my game's source control repository?

I have started working on a personal project using Unity with a friend and we've set up our own source control system. I am aware of the fact that there are many types of files, namely those that are ...
11
votes
6answers
6k views

Do Game Objects which lay outside camera view consume computer/mobile resources in Unity?

In unity, let us suppose that I have some Game Objects in my scene that are not visible to camera and so are not rendered while the game is running. Will these Game Objects be consuming computer/...
11
votes
2answers
2k views

A* pathfinding for dynamic obstacles and player made blockages?

Hi I'm creating a TD in Unity 5 and need some help with my Pathfinding. I'm going to use Arons A* pathfinding for my AI which enables me to use dynamic objects and update the path during run-time. ...
11
votes
2answers
9k views

How to upgrade a project in Unity Hub

Before Unity Hub, it used to be the case that if you opened up a project that was from an older version, you would be prompted to upgrade the project. I am now on the latest Unity Hub 2.0.0 and I am ...
11
votes
1answer
77k views

Change the sprite of a Object in Unity

Inside the script code of the the hero(object) I want add the possibility to change its sprite. So the player hits the space button and the sprite changes into the other sprite already added to the ...
11
votes
2answers
13k views

Unity on Facebook?

Hey, I know Flash works using Facebook, and I think I've seen some Java stuff on there too, but does anyone know if the Unity Player can be used in Facebook?