Questions tagged [unity3d-2dtools]

Use this tag if your question is about using Unity's built-in 2D features, like the Sprite type and the 2D physics engine, based on Box2D.

The 2D Tools refers to the collection of tools to make 2D applications.

Useful links


Related tags

492 questions
4
votes
1 answer

How to write a Unity Shader that respects sorting layers?

I want to sort my Sprites using Unitys sorting Layers. I attached a custom Shader to one of my Sprites. Sadly the Sprite with this shader always draws behind the other Sprites disrespecting the sorting layer. How to implement sorting layer respect…
f.b.
  • 490
  • 1
  • 5
  • 17
4
votes
2 answers

How can I save Unity Statistics or Unity Profiler Statistics (stats on CPU, Rendering, Memory...) in a file (text or CSV ...)?

I need to know please if I can save the profiler statistics (http://docs.unity3d.com/Manual/ProfilerWindow.html) and/or Unity Rendering Statistics (the overlay window that shows realtime statistics) -…
HB87
  • 413
  • 7
  • 16
4
votes
6 answers

Unity3d: No Drag&Drop has been setup

I was working on a Unity 2D game project on OS X 10.10, and I can't drag file or folder, it will show this error. No Drag&Drop has been setup. Please UnityEditor.DockArea:OnGUI() I have tried: save project and then restart click Assets folder and…
rj487
  • 4,476
  • 6
  • 47
  • 88
4
votes
5 answers

Unity New UI Image changing Color not working

im trying implement health to my player using unity new UI Image system.but its not working.can anyone help me.Thank you. using UnityEngine.UI; if (health_value == 3) { GameObject.Find("health").GetComponent().color.a = 1; …
hash
  • 5,336
  • 7
  • 36
  • 59
3
votes
1 answer

How to clear LineRenderer path to redraw the line?

I have a LineRenderer path to show the path of the GolfBall. Please see in the image, maroon colour path. private void createTrail() { lineRenderer.SetColors(tracerColor, tracerColor); lineRenderer.SetVertexCount(maxVertexCount); for…
batuman
  • 7,066
  • 26
  • 107
  • 229
3
votes
1 answer

Making object Instantiate only when the specific attack animation is complete query

My player Robot is attacking when I click on the attack button as follows. I am using a coroutine to wait for some time then instantiate laser form firepos position. Please see the below gif for clear understanding: Now if u see the above gif you…
utkdub
  • 274
  • 2
  • 12
3
votes
2 answers

Unity Error: UnityEngine.Component' does not contain a definition for `velocity'

I am very new to C#, so forgive me if this is obvious. I am following the steps in this tutorial and have run into a problem on step six. The error it gives is this: The error it gives is this: UnityEngine.Component' does not contain a definition…
Johnny Dollard
  • 708
  • 3
  • 11
  • 26
3
votes
2 answers

Flip a 2D character, using inverse kinematics, in Unity

I have a rigged 2D character with Sprites And Bones in Unity and I use inverse kinematics to animate it. But if I want to flip the X-axis, my character go berserk : I have a script attached to "Karateka", containing a simple Flip() function…
Cyrille
  • 13,905
  • 2
  • 22
  • 41
3
votes
0 answers

InvalidOperationException: This cannot be used during play mode, please use SceneManager.CreateNewScene() instead

As i am new to unity . I am trying to automate Unity game using unity inbuild tool "Editor Tests runner". I am able to write test cases but when i am running test cases getting below error. InvalidOperationException: This cannot be used during play…
3
votes
1 answer

How to approach weighing scales in Unity 3D?

Currently I am creating a 2d platformer in unity using C# and I was wondering how I would approach creating a weighing scale like the one below. To explain, I want it so that when a heavy rigidbody2d is placed on one of the scales, the other scale…
Gazz
  • 1,017
  • 3
  • 17
  • 31
3
votes
3 answers

C# in Unity 3D/2D: Am I required to use Classes for every script?

A little background: I'm new to C# and Unity, but catching on very quickly. I'm also hoping this thread will not spark a debate about the merits of classes and abstract coding, as that debate is unrelated and well-worn (and unnecessarily heated); so…
John Lardinois
  • 109
  • 2
  • 11
3
votes
1 answer

Why does Social.localUser.Authenticate lead to crash when there is no internet connection in Unity app?

With an internet connection Everything works flawlessly. There is no memory problem leading to crash. With no internet connection The app proceeds to the menu screen, where it eventually crashes because it is out of memory. I have concluded that the…
JessThePest
  • 155
  • 2
  • 11
3
votes
1 answer

Unity2D Collision Detection Issues?

I am making a mini game and was just wondering if anyone could possibly help me with some collision detection. Currently I have an item with Rigidbody2D and a BoxCollider2D attached. It falls from the sky. I then have a floor(With a BoxCollider2D…
SGW
  • 31
  • 5
3
votes
1 answer

How to make 2D colliders scale with the UI element they're bound to?

I'm still quite new to Unity and I'd appreciate any help on this problem. I have this setup which works well using the screen resolution I was designing on. I believe the UI elements scales well when I change the resolution but I just found out that…
Ferdie
  • 33
  • 1
  • 6
3
votes
1 answer

Make texture2D readable in runtime/script Unity3D

I have a plugin that allows me to access pictures from an Android phones gallery. This gives me a texture of the Texture2D type. I then want to edit it using the GetPixels function, but it is not set to readable by default. How would I make the…
Waltari
  • 1,052
  • 1
  • 30
  • 64
1 2
3
32 33