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
2
votes
1 answer

Change Source Image of a UI Button when a mouse is over it? (Unity)

Hello I'm new to Unity and I'm trying to make a UI button change its Source Image when the mouse is over it, and when the mouse is no longer over the button, the button's Source Image is back to normal. I know that a sprite is needed to be the…
2
votes
1 answer

Unity3d 2D Raycast calls sometime passing through PolygonCollider2D's points

I'm a Unity beginner! The rays from my Raycast2D calls sometimes pass through points of my PolygonCollider2D and I don't know why. Hits are marked in the following images by a small yellow horizontal line. Expected behavior: A ray passing…
Ploppy
  • 14,810
  • 6
  • 41
  • 58
2
votes
2 answers

Continuous input from eventTrigger OnPointerDown

Just like Input.GetKey() for keyboard is there any way to take continuous input from UI button event trigger OnPointerDown ? Because for movement controls with animation its giving very weird output? I have to click it again and again which I don't…
utkdub
  • 274
  • 2
  • 12
2
votes
1 answer

How to keep sprites position after Unity animation?

I just recently began using Unity3D and this is my first game, so if I'm not doing things like I'm supposed to, please tell me. There is a 2D character that I want to move one step forward using the Animation mechanism. This movement can be splitted…
Cyrille
  • 13,905
  • 2
  • 22
  • 41
2
votes
1 answer

Change order of frames in unity 2D

How do I change the order of the frames being played in an animation without screwing the animation up. I tried changing the name of the files but that did not work. Any ideas? this is the order I have right now:
SafeSailor
  • 59
  • 7
2
votes
2 answers

How do I randomize an object's position?

This is some code that instantiates prefabs of two different types and places them in a random spot. The prefabs instantiate, but don't instantiate randomly. How can I fix this??? using UnityEngine; using System.Collections; public class Spawner :…
VolcanicTitan
  • 121
  • 1
  • 5
2
votes
4 answers

UNITY 2D: Player flying when space/mousebutton is holded

So basicy i need my character to go up when space or mousebutton are pressed. I added rigbody 2d and box colider 2d to my gameobject (player). The problem is when I hit space or mousebuttonit only jump not constantly moving up. Here is my…
2
votes
1 answer

Particle system behaviour different for game objects consisting of several gameobject components

I have a 2D game. I have game objects that are made of a singular shapes with colliders and some that are made out of several shapes and included in an empty game object to which I have added a character collider. All the game objects have…
user3956566
2
votes
1 answer

Unity2D: Add text to rigidbody2D element

I'm new to Unity and I started with the Catch Game Tutorial to learn to create a 2D game. Everything is working now but for my needs, I would like to add different textboxes to each of the fallen elements (in the tutorial the bowling balls) Those…
2
votes
1 answer

Unity C# 2D Instantiate and manipulate a projectile as a child of player

I want to instantiate a projectile and be able to rotate it as a child of a parent player object. My player has a 2DRigidbody and box collider 2D, my projectiles also have a 2DRigidbody and box collider 2D, so when I shoot them from the player they…
2
votes
1 answer

Twitching camera image during movement. In Unity 2D

I'm trying to make simple 2D runner. I'm using Windows 7 Ultimate (SP1), Unity 5.3.2 (also tested with 5.3.0, 5.3.1, 5.2.4). I've caused a bug which is visible in editor, standalone builds, Android builds. I've created new project in 2D. And put a…
Dmitriy Yerchick
  • 1,341
  • 1
  • 7
  • 9
2
votes
1 answer

Unity2D - Level with invisible collisions

In my Unity2D project I want that to load a level as a sprite from my resources. The game is a top down view. I then want to add invisible collision boxes where the walls in the level-image are. How would I do that? I have attached a box collider to…
Ian H.
  • 3,840
  • 4
  • 30
  • 60
2
votes
5 answers

Creation of a score system in unity

I am currently developing a simple 2D game to learn many things about game development. Nevertheless, I have some issues to create a score system. I want to update the score every second, and adding 1 point for each second, and stop the count when…
Ophélia
  • 241
  • 2
  • 6
  • 16
2
votes
1 answer

input.getaxis returning -1 by default unity 5.3.0

using UnityEngine; using System.Collections; public class Player : MonoBehaviour { public float speed = 8.0f; public float maxVelocity =3.0f; // Use this for initialization void Start () { } // Update is called once per frame void Update ()…
Mitesh
  • 1,544
  • 3
  • 13
  • 26
2
votes
1 answer

Unity 2D Physics: angle limits and motors are preventing rigidbodies to sleep

Aim: I'm developing a turn-based game that heavily relies on Unity's 2D physics. It's important for me that all bodies go to sleep as soon as they stop moving, because I'm waiting for it to start next turn. Issue: Unfortunately, it happens quite…