Tagged Questions
0
votes
1answer
72 views
Camera controller in a 2d platformer
I'm basically bumming around using Unity's 2D creation tools, and I've managed to create a little platformer physics demo. There's a lot of work to be done, but I've got basic movement down, some ...
0
votes
0answers
23 views
Simultaneous Animation for a GameObject - Unity3D
Its my second week with Unity. I am doing a 2D game and I have a small GameObject which should change its sprite along with following a definite path defined in Animation Curves.
I did both of them ...
0
votes
0answers
20 views
Using a Quad to cut out a Layer?
Looking for options on this, but I wanted to take a Quad (or other shape), apply a material to it, and have it cutout an entire layer, to reveal the layers below/behind it. Sort of like a portal ...
2
votes
1answer
212 views
How to simulate wind in 2D
for a 2D scenario, I wanted to have a fan blow at an object and make it move with the "wind", how can I simulate the wind under these circumstances?
0
votes
0answers
68 views
How can I animate 2d sprite rotation without interpolation?
I would like to animate a weapon being swung in 2 frames - all I'm doing is changing the position and rotation of the weapon sprite. However, I don't want unity to interpolate the rotation (generate ...
2
votes
0answers
81 views
Can the Shuriken particle system create particles with random shapes and sizes?
I want to create differently sized (but small, relative to the characters) dust clouds for player movement that move away from the player and fade away by shrinking.
This animated GIF from Samurai ...
1
vote
0answers
26 views
Unity 2D angular velocity center
I try to add angular velocity to my GameObject with this command:
rigidbody2D.angularVelocity = Random.value * tumble;
All works, but I want center of velocity be in the center of my rigidbody, but ...
2
votes
1answer
87 views
Inverse Explosion with Unity2d
I am currently trying to make all other objects push away from the player when the player explodes. It currently works, but it pushes close objects a little and far objects very far. What I want is ...
1
vote
1answer
110 views
How to compress Unity apk output?
I made a game with Unity but the size of .apk file got so large, it is about 70mb...
Is there some way that I can compress my apk file?
0
votes
1answer
120 views
Unity3D : Pause Menu - Android
I am making a 2D game for Android. Almost completed the game but now I need a pause game option. I added a pause icon on the top right side of the screen. The icon is a GUI texture.
What I did so far ...
1
vote
0answers
35 views
unity4.3 rigidbody2d unexpected force behaviour
So guys ive edited the question and here is what my problem is i have a player which has a rigidbody2d attached to it.my player is able to doublejump in the air nicely and stick to walls when ...
4
votes
1answer
211 views
Unity falling body pendulum behaviour
I wonder if someone could provide some guidance.
Im attempting to create a pendulum like behaviour in 2D space in Unity without using a hinge joint.
Essentially I want to affect a falling body to ...
4
votes
3answers
208 views
Why does Unity in 2d mode employ scaling and the default othographic size the way it does?
I previously used SFML, XNA, Monogame, etc to create 2d games, where if I display a 100px sprite on the screen, it will take up 100px. If I use 128px tiles to create a background, the first tile will ...
0
votes
1answer
111 views
Background Sprite Setting
For my 2d game, I want to set background image. So that I am using multiple background images for that purpose.
But it can't set correctly on screen that illustrated in following image.
Also for ...
0
votes
0answers
76 views
How to implement 2D Ai Wandering with 8 - directional movement using Perspective Images in unity 4.3?
My requirement is to move a 2D characters with perspective view images has to wander in game area by choosing dynamic path and according to that the AI character has to switch the
animations based on ...
1
vote
1answer
124 views
Unity 2D camera drifts from player as speed increases
I have a dilemma that I did not have in XNA before porting my game to Unity.
First-- my goal is to mimic Super Mario World 2's camera tracking in x. The camera tracks to 1 block ahead of the player, ...
1
vote
1answer
208 views
Dynamic 2d terrain loading / stitching in Unity [closed]
I'm currently working on a top down 2d game (in Unity 2d) where I'd like to build a huge terrain for the player to explore.
My question is - do you have any good practices or ideas on how to chunk the ...
7
votes
2answers
936 views
Constant 2D Bullet movement in a shmup
I've been following the pixelnest tutorial to make a 2D shmup (http://pixelnest.io/tutorials/2d-game-unity/player-and-enemies/).
While working on this I've experimented with increasing the firing ...
0
votes
1answer
155 views
2d OnMouse(anything) Not working
So I want to be able to click on these targets and have them destroy themselves. Right now I have many OnMouse functions all just trying to print something for testing. For whatever reason it doesn't ...
1
vote
1answer
144 views
Animating feet seperately from the body
I have a character and I would like to animate a walking animation for it. However i get the following result when I animate it:
(ignore the green lines/ markers/ sound) As you can see the foot ...
2
votes
2answers
123 views
Print on the GUI in Unity
I'm trying to show the players name on the GUI with a label.
GUI.Label(new Rect(10,10, 100, 30), playerName);
Instead of use the default style I want to use a different font with larger character.
...
0
votes
0answers
89 views
Unity not updating sprite animations (possible bug)
I have a simple animation of a foot which i want to change sprites from one sprite to another, which is seen in the following two images:
now as one can see in the animation timeline there is a ...
1
vote
1answer
58 views
How can I make an attached gameobject behave correctly on character flip?
I have a character that on start-up is equipped with another gameobject/prefab as a weapon, attaching it to a hand.
void Start()
{
handFront = transform.Find ...
0
votes
2answers
731 views
How do I randomly spawn objects in 2D game?
How do I randomly spawn few different sprites on screen so they're not overlapping or half visible on render. The sprites should immediately start shrinking until they disappear.
I've tried to ...
0
votes
0answers
218 views
Unity 2D - SpotLight and Shadow
I've been having some trouble in the process of creating my 2D game. Here is the thing, i want to create a light source on the top of the screen, blocked by some rocks and letting only go through some ...
0
votes
1answer
1k 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 ...
1
vote
0answers
87 views
How do I load real-world map terrain? [duplicate]
I'm new to game development and want know how to make or load a terrain from OpenStreetMap or Google Maps in your current city. (I'm using Unity3D.)
My idea is just load or generate a map of the ...
0
votes
1answer
43 views
Stopping sprties from toppling off platform
I am new to Unity and am trying to create a simple 2d platformer. I have applied a box collider to my player sprite and the floor/platform its standing on. Now when I go over the platform, it toppes ...
1
vote
2answers
1k views
Unity 2d: How stop movement when object hit a wall
I created a square that slides on a flat ground.
public class PlayerMoveScript : MonoBehaviour
{
float move = 0;
void Start (){}
void FixedUpdate ()
{
if (move == 0) {
...
0
votes
1answer
275 views
Unity - Light and sprite collision
I'm a beginner in Unity and i'm facing a little problem / question.
The main purpose of my 2D game is based on the mouvment of a specific light and the player have to avoid getting inside his rays. My ...
1
vote
0answers
365 views
Unity 2D loading Spritesheet Atlas at runtime from web and using it dynamically
I am new to Unity (came from AS3/Starling) and just started for 2D games in Unity. I have a spritesheet / texture-atlas (many different sized images packed in a single png) which I want to download at ...
0
votes
1answer
220 views
Skeletal animation with Unity2D?
I want my character to aim with the mouse so, arms and head must move following mouse cursor and when the character is stand still it could change its stance a bit to accommodate the arms position. I ...
20
votes
2answers
1k views
How do I make a character capable of walking on walls?
I am trying to get a character to move like a spider: Given a rising slope which a ball would normally not be able to roll up, the spider would slowly crawl up.
Similarly, given a mid-air rectangular ...
0
votes
1answer
650 views
Platformer raycast collision detection
I'm using Unity to create a 2D platformer. For collision detection, I'm using raycasting to detect any possible collisions with specific collision layers, and adjusting the desired delta x & y ...
1
vote
1answer
229 views
Each level is one scene?
I'm planning to get into Unity 2D tools - so in order to start off I decided to create a little breakout clone. However, I'm not sure how to manage levels. When I wrote Breakout using MonoGame, I just ...
1
vote
3answers
488 views
Two sided sprites
What is the most efficient way of making two sided sprites in Unity's new 2D tools? I'm looking to make playing cards with a backside and a front side.
3
votes
2answers
226 views
How can I create an array of GameObjects?
I need to add one 2d assest multiple times in my scene and I was wondering what is the best way to do this because adding each asset individually and setting there locations doesent seem like the best ...
1
vote
1answer
516 views
How should I handle animation states in Mecanim?
I did a tutorial which associated an integer to each state and manually set transitions from one state to another based on that integer, but that seems really sloppy.
Is there a more elegant way? I ...
0
votes
1answer
1k 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
333 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 ...
1
vote
1answer
220 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, ...
1
vote
1answer
197 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 ...
0
votes
0answers
443 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 ...
6
votes
4answers
482 views
How does creating 2d game assets differ from regular 2d art? [closed]
I've done some digital paintings and concept sketches in the past, and I was thinking about employing those skills in my game making efforts.
From an artists standpoint, what does he have to do ...
-1
votes
4answers
1k views
Too much animation work for 2d characters. Creating 2d character animations by prerendering an animated 3d model?
I've read a bit about creating assets for games and the consensus seems to be that 2D is cheaper than 3D in all aspects with the exception of character animation. That's caused by the need of ...
2
votes
1answer
414 views
How do I make an object face the mouse position, but only on one plane?
I want a game object to turn and look towards where the mouse was clicked (in world space). It works well when considering all 3 dimensions, but I really only care for the plane formed by the x and z ...
1
vote
1answer
777 views
How to crop or mask a sprite to a specific shape in Unity (2D)?
I'm trying to do a procedural 2D terrain generation. I've managed to make the function to generate the points, and I've been testing/debugging by creating the terrain using a 2D polygon collider on an ...
4
votes
1answer
3k views
Multiple resolutions for Unity 2D Android game
I'm trying to target as many devices as possible by providing a consistent experience. So I'm trying to make sure the aspect ratio fits each device it's played on.
After reading some forums and ...
2
votes
1answer
177 views
Unity Get corners of camera in world space
I'm making a 2D game and i need to get the corners of the camera in world cordinates. Is this possible in unity?
8
votes
2answers
1k views
What is the difference between Unity's Sprite and Texture2D classes?
Unity has both a Texture2D class and a Sprite (with related SpriteRenderer). What is the difference between these two classes? Both represent an image, for 2D games should I favor one over the other?
...