Orthographic camera zoom with focus on a specific point

I have an orthographic camera and would like to implement a zoom feature to a specific point. I.e., imagine you have a picture and want to zoom to a specific part of the picture. I know how to...

Dragging an object by touching Unity3d with android sdk

I am trying to move and object by touching it and dragging. I am testing it on my Samsung Galaxy SIII. I have used the following code. For some reason it moves faster than my finger. It should...

Rotate object in Unity 3D

I can use the following code to rotate object using accelerometer. transform.rotation = Quaternion.LookRotation(Input.acceleration.normalized, Vector3.up); But i would like to rotate object like...

Extending Unity UI components with custom Inspector

Is it possible to extend the new unity ui components like for example the transform component? Because nothing happens when i try to extend the button, instead of the transform component using...

How to pass data (and references) between scenes in Unity

How can I pass score value from one scene to another? I've tried the following: Scene one: void Start () { score = 0; updateScoreView (); StartCoroutine (DelayLoadlevel(20)); } public...

Awake() and Start()

I see that we can initialize Variable in Awake() or Start() and Awake() will be called before Start(). When should we initialize in Awake and Start to have the best performance?

Unity3d and building WebGL (Unable to load DLL 'QCARWrapper') [Vuforia]

When i'm trying build project to WebGL and run in a browser (Chrome, Safari, Firefox), i got an error: DllNotFoundException: Unable to load DLL 'QCARWrapper': The specified module could not be...

WebGL - Open URL in new tab?

How to open URL in new tab for WebGL? Tried Application.OpenURL("url"). But it's opens a tab in same window Thanks

C# Unity - How can I clear an InputField

I want to clear an InputField in Unity, but I cant get it to work. What I do now is: public InputField inputfieldname; inputfieldname.text = ""; but then it doesnt clear the field until you...

Is there a better way to create a color picker in Unity C# and NGUI?

I am creating a bit of an art program / game in Unity, however I need to create a color picker for the artists who are building things inside it. I am using the NGUI UI system, and I've created a...

PNG file displayed as red question mark after download with HttpWebRequest

I face the following issue: I downloading a png file from google drive, all bytes are successfully received (as it seems), but when I try to construct a Texture2D and set it as Sprite in an Image,...

Where is adb located when installing Unity and Android SDK for Mac?

I'm getting Android Build Failures and would like to locate adb to do some queries like adb devices but where is adb installed? I've already installed the Android SDK for Unity.

How to build an iOS Unity Project for iOS Device as well as iOS Simulator

Currently i have a unity project which runs on iOS device or iOS simulator. I have choose SDK choice in unity project player settings ,option available for choose either device sdk or simulator...

how to snap two objects in runtime in unity?

this is the 3d model i wanted to connect another model like this to its silver connectors on top side and also another model to right side(so do help me to snap it)I want to know how to snap two...

How to move 2D Object with WASD in Unity

My code below only works for horizontal movement. Shouldn't the vertical movement be working too? I'm just starting out with basic 2D Unity programming: public class Player : MonoBehaviour { ...

error CS0234: The type or namespace name `iOS' does not exist in the namespace `UnityEditor'. Are you missing an assembly reference?

I have installed the latest versions of Unity (2017.3.1), Daydream SDKs (GVR SDK for Unity v1.130.0) and followed the steps here:...

Unity Double Click event

I am new here and I'm beginning my adventure with UNITY. I have problem with double click event. I'd like to buying or selling something in my shop. When I assign a button on unity (public Button...

What is a Vector2 and Vector3 in Unity?

Title says it all. I see them used in movement scripts often, if that helps. What is a Vector2 and a Vector3, the Unity docs are a bit hard to follow for new people.

Grid show in game in Unity2D

When i press "Play" button in Unity2D i can see "grid" that should be invisible in game. I use build in tiledmap option in Unity 2D. This "grid" looks like space between tiles, but my tiles is...

I can't activate the license in unity hub

I reinstalled windows 10. I downloaded unity hub from the official site. Running unity hub I saw the error "You have no valid license". There are 2 buttons "manage license" and "dismiss" on the...

VS Code IntelliSense not working for Unity3d

Problem: IntelliSense is not working for Unity specific methods and functions (i.e., Update, FixedUpdate, Awake, etc.). It does work, however, for non Unity specific methods (i.e., IEnumerator,...

Unity type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine'

I have installed the new InputSystem package in my Unity project. I have set the input to "new inputsystem" in the Unity Player Settings. I have quit and restarted both Unity and VS Code. But...

Unity ArgumentOutOfRangeException when loading Collaborate history

I have been unity collab for sometime and everything was smooth. However this morning, when trying to load my teams' changes from collab's history I got this weird...

I get MDB_MAP_RESIZED error in Unity, how can I fix it?

Excuse me if this has been posted before, but I can't find a solution that works for me. When I run a little 2D-game I'm working on in Unity I get following errors: > Assertion failed on...

How do I get all overlapped Collider2D on any layer in LayerMask array

I need to choose all elements in the array public LayerMask[] ground; I have a problem "Wrong number of indices inside []; expected 1", with: a = Physics2D.OverlapCircle(bottom.position, radius,...

How do I make Rigidbody movements in a first person shooter in Unity?

So I am making an FPS game in Unity, and I used to use transform.translate for movement, but that allows the player to move through walls if moving fast enough (diagonal movement) and it doesn't...

Unity Mirror not Importing correctly

I was following this tutorial https://www.youtube.com/watch?v=8VVgIjWBXks about making a multiplayer game in unity using Mirror...

why are the spawned game objects with Instantiate are invisible in game but visible in scence when i press play in unity (2d game)

I don't know what can cause this problem , those game objects : enemy (spawned) can't see them in game I need your help thanks in advance .

Unity Animation Rigging isn't working proplery

I've been using the animation rigging package for quite a while but I've never struggled with this issue. When I use the two bone constraint, the arm will weirdly twist. I've tried many things...

Autotests for Task.ContinueWIth logic

I'm trying to cover some logic with unit tests and have a problem with Task.ContinueWith method. The problem is that I have an important logic in the ContinueWith task. The ContinueWith task will...