Questions tagged [2d]

2D refers to two dimensional space where coordinates are represented with X and Y values.

Filter by
Sorted by
Tagged with
0
votes
0answers
15 views

Weird “jiggly”/“warping” effect on my tiles

I need help with a problem I'm having in Unity regarding a "jiggly"/"warping" effect. It is a strange effect which occurs when I move my sprite character and makes the tiles have ...
0
votes
1answer
34 views

How to best simulate the space in a boxing game to account for footwork and angles?

When trying to prototype a (top-down, so far) boxing simulation I've run into a huge roadblock with trying to set the space in which the boxers will fight, because it's important for the fighters' ...
0
votes
0answers
25 views

How to choose between 2D sprites versus 3D models for a 2D game?

I wanted to know how to decide between using 2D vs 3D models for games. What are the advantages/disadvantages of using 3D models versus 2D sprites in 2D games?
1
vote
1answer
17 views

Dynamic Sort order For walking in front and behind stuff

I'm using tile maps, and I'm having a difficult time with the concept of walking both in front of things, and behind things and having the layers sort order show properly. Take the image below, I need ...
-1
votes
1answer
59 views

If player is not holding the ladder then it should not jump twice

I am using Unity2d and I am stuck with a problem. I made the new layer for ground and ladder and added OverlapCircle and make double jump script for the player, so ...
0
votes
0answers
11 views

Make a child sprite match the layer ordering of its parent

I have my project settings set up to order the sprites' visual layering based on their y position. If I add a sword as a child to my character, the sword won't have the same order as the parent so ...
2
votes
1answer
50 views

8-way aiming in run 'n' gun

I am developing a 2D run 'n' gun game in Unity and am having an issue getting the aiming to "feel right". Some background: The player can aim in 6 directions when running (left, right, and ...
0
votes
1answer
44 views

How do I detect if my object is grounded?

I am trying to detect when an object is grounded. My script right now is: ...
0
votes
0answers
16 views

(Unity Engine) Is it possible to make 2d animation bones perfectly straight within the sprite editor

I am experimenting with pixel perfect camera and 2d animation. I noticed in the skinning editor that there is no option to edit bone coordinates. When I make an ik it extended the arm making it ...
0
votes
3answers
54 views

Sticking the Rigidbody2D player to a moving platform without parenting & transform fiddling

I have a player entity with Rigidbody2D component and I have a moving platform which is a kinematic Rigidbody2D. Player movement is done by setting it's velocity (...
0
votes
1answer
59 views

Make enemy move diagonally in 2D

I'm making the enemy follow the player only straight or diagonally e.g.(1,1)(1,0)(0,1)(-1,1). I expected the problem that I have, but I don't really know how to fix it. When my enemy is placed ...
0
votes
1answer
21 views

When pressing both the key then releasing any1 key then the anination is not played

i give the running animation to the character and created a flip script...when press A then player move and flip to leff and animation is played ....when press D then player move and flip to write and ...
0
votes
1answer
51 views

High-performance update of a bitmap grid

I need to visualize a fast paced process in .NET in 2D. I am planning to use writeable bitmap 800x40px. The idea is like this - there are objects which are represented by very basic colours and sizes ...
1
vote
1answer
40 views

How should I setup my sprites for 2D combat?

I was painting pixel sprites of a goblin (the enemies in the game). I first thought of making sprites of it for each different scenario: facing camera, moving toward camera 1, moving toward camera 2, ...
0
votes
0answers
26 views

How to perform a sliding collision between a square and a circle?

Please point me to the duplicate if this has been asked before. I couldn't find it. Basically, I am creating a 2d top-down game where the player is represented by a circle, and the tiles are ...
0
votes
1answer
11 views

Select box-shape grid between two positions on tilemap

I want to be able to click and hold on a certain point and mark it as startPosition. Then, while the mouse is held down and moved, mark that second position as <...
0
votes
1answer
21 views

Experiencing strange behavior in Unity when rotating a 2D GameObject according to the slope it is standing on

I am trying to rotate a square GameObject, so it appears to be standing perpendicular to the slope underneath it. However, when above a slope, the square constantly "spins"; it seems like ...
2
votes
3answers
262 views

Place Buildings to represent village

I try to convert an array of Buildings into a representation of a small village. There are several different buildings in a village, like factories that are located on the outside of the village, ...
3
votes
2answers
145 views

Why is my jump arc preview inaccurate?

I'm trying to draw an arc out of dots that previews a KinematicBody2D's trajectory after a jump but said preview always falls short of the body's actual jump and I cannot figure out why. Below is an ...
0
votes
1answer
38 views

Select specific tile in Tilemap

I am following this video tutorial on how to implement drag-to-select behavior like in an RTS. The only difference is, I'm using a tilemap. The selection area is a square which I can drag to make it ...
0
votes
1answer
20 views

RaycastHit2D.point is acting weird when used with circlecast2d

When I make circleCast2d intersects with another circle collider, I get a RaycastHit2D.point that doesn't point at the tip of ...
0
votes
1answer
22 views

Rotating player around planet causes drift in gun aiming at mouse

I have a bug with the rotation of a gun object that follows the mouse position. It has issues when the parent object player rotates. Example: The player has a gravity script to keep them aligned with ...
0
votes
1answer
56 views

Making a 2D gun spin from recoil when it shoots

I am trying to clone the game "Flip the Gun" as an exercise. Here is the behaviour I have so far. And here is the code I am using: ...
0
votes
1answer
26 views

Place tiles along a specific axis / direction

I want to be able to place tiles only in the direction I've started "drawing" them. For an example, if I click and hold on tile at position (0,0), and ...
0
votes
1answer
24 views

Normalize a rotation around the Z-axis (issue with GLM)

I'm trying to undo some transformations coming from an external tool*. I'm getting different results depending on subtle differences in the input and wondering how to convert to a rotation about the Z-...
0
votes
1answer
38 views

How do I get my fish to face the right way?

I'm making this 2d collecting game in Unity where you collect fish. However I can't get them to face the direction they are going. I've asked on some Discords and got no answer. Thanks in advance. ...
0
votes
1answer
25 views

Resizing canvas to match screen size in Unity WebGL

I'm learning how to make a browser game with Unity. I have set up the screen display dimensions to 960 x 640 (I read that it's a safe resolution to use. Feel free to correct me). I created a Canvas ...
0
votes
1answer
27 views

(Hitbox) OnTriggerEnter2D only work if enemy is moving

(UPTADE) I am developing a 2D Topdown Rpg Game. I have a problem with trigger colliders. I have button which make active an object and ı use it like Hitbox when i press button ı destroy enemy if it is ...
0
votes
1answer
25 views

How to stop Players and Enemies from pushing each other

I am developing 2D Top-Down RPG game. I have script that makes my enemy follow the player, and when they touch the player, the player will start to lose HP. Everything works well, but when they touch ...
0
votes
1answer
16 views

Maintaining facing direction at the end of a movement

I want to make my 2D top-down walking animation stop and revert to the idle animation while continuing to face in the same direction as the previous movement. For example, when I go up then stop, my ...
0
votes
0answers
15 views

2d packing shapes in rooms

I'm not sure of the correct terms for this so having a hard time searching. But I have a series of 2d top-down rooms made up of random grid sizes between say 5 and 10 on the x and y axis. Each room ...
3
votes
1answer
63 views

My Earthbound-like Movement Script works in Unity Gameview, but runs differently in Gamebuild

First programming question I've ever made in my short journey. I'm trying to create a script which moves members of your party in a line behind you (think Chronotrigger or Earthbound). Here's a clip ...
0
votes
1answer
48 views

Press and hold camera movement with mouse in new Input System?

I am transitioning to the new movement system and am having trouble figuring out how to move the camera when a mouse button is pressed and held. Here's how I did it before: ...
0
votes
1answer
34 views

How to apply Time.timeScale only to certain scripts?

I have a need to pause my game and the simplest and most clean way that I know of (other than completely designing my own time system) is by using ...
0
votes
0answers
18 views

Controlled Wall Jump 2d Platformer

I would like to be able to control the intensity of the wall jump of the character, enabling the character to jump in short bursts upwards a wall and in long button presses across the wall. I have a ...
2
votes
1answer
68 views

Predicting trajectory of Box2D physics body using both: linear dumping and gravity

I would like to calculate position of physics body after some time because of predicting shots trajectory in my game. I found some great answer here where Iter Ator provides equation to calculate ...
0
votes
2answers
57 views

Performance of many canvas drawImage calls is very slow

I'm developing a top-down 2D tile-based canvas game. I have a single sprite sheet of all my tiles, and then a JSON tile map array of where they're placed. Previously I would render all the layers of ...
1
vote
0answers
20 views

Corgi Engine - Character glitches with “jump” animation on top of a ladder

I'm new to Corgi Engine and Unity in general. I have an issue that I could find a way to resolve. I'm using CorgiEngine's "RetroLadder" prefab and extended "Rectangle" character ...
0
votes
2answers
35 views

“Update cannot be an iterator block” when trying to wait for jump to finish

As of now, I'm getting a C# error (CS1624) stating that: The body of PlayerMovement.Update() cannot be an iterator block because void is not an iterator interface type. The error is within the ...
0
votes
2answers
33 views

Main Camera re-sizing in 2d

My UI : An UI from YouTube video : Look my camera's size is 10 and his camera's size is only 5. But, my camera's width is larger than height. If you look at scale (x,y,z)=(1,1,1). I tried to change ...
1
vote
1answer
30 views

Is it possible to somehow change the collider points to match sprites during the animation in Unity?

Is it possible to somehow change the collider points to match sprites during the animation in Unity? I am using the Unity built in animtion recording feature. I would like to change the points of some ...
0
votes
0answers
78 views

How to draw a rectangle at x,y where x & y are in pixel?

Here is my code : ...
1
vote
3answers
166 views

How to Make Border of 2D Game in Unity

I have a border by default. But, I'm having trouble detecting if my object collides with the border. I am looking for efficient ways to do this, and I am not sure what should I use. I thought using a <...
0
votes
1answer
62 views

Character falls through the Platform Effector 2D in Unity. How can I fix it?

Character falls through the Platform Effector 2D in Unity. How can I fix it? Here is the demonstration: https://imgur.com/G5YkTxa. I tried changing the Edit - Project Settings... - Physics 2D - ...
1
vote
1answer
52 views

How can I jump down from a platform in Unity?

How can I jump down from a platform in Unity? I use two 2D colliders: one is my character, another one is platform. These colliders allow my character to stand on platform. Now whenever a characters ...
0
votes
1answer
76 views

UNITY: How to LOAD save file from main menu

So I've created a simple main menu with a new game, load game, and quit game buttons. In the new scene where I've created pause menu save/load buttons work, I've created a new object and attached a ...
0
votes
1answer
32 views

How to Change an Icon based on what Collider the Player Hits

So I have a 2D platform game where a player goes around collecting fruit but currently I only have one icon. Currently I use an image on a canvas to display the fruit image. How can I make the UI ...
0
votes
1answer
59 views

Item counter unity

How is it possible that a create an item counter in unity? My current Scripts - Counter.cs ...
0
votes
0answers
12 views

How to see the surface arc in Unity?

How to see the surface arc in Unity? There is the tutorial and in this tutorial we can see the arc in editor: While I can not see it. I checked that all my gizmos are enabled. How can I enable the ...
2
votes
1answer
55 views

2D shadow from polar coordinates has hard cut-off at a certain radius

I'm trying to cast shadows from a 1D texture that goes from white to back according to the distance given by an occlusion map. That part I think I got it right. The problem lies on the algorithm to ...

1
2 3 4 5
64