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
58 views

How do I generate a random map with islands (like the Earth), using Perlin Noise, on a tilemap in Unity?

EDIT: I've tried this with Perlin Noise with no success, then with Voronoi diagrams, and now I'm editing the question to reflect the issues I had with Perlin Noise, trying again. I'm developing a ...
0
votes
1answer
31 views

How can i properly display 2D Pixel sprite's pixels without distortion while it's moving ? (in unity)

Introduction to what i'm trying to do Hi, I'm trying to make a 2D Pixel Platformer Game in Unity. Before that i used godot and for some reasons (not about the engine) i switched to unity. And in ...
0
votes
1answer
20 views

SDL Difference Between using Surfaces and Renderer (C++)

I am new to SDL and I've been following some tutorials, in one tutorial he used Surfaces(a window surface and image surface) and BlitSurface function to draw images without using any renderer(used SDL ...
0
votes
1answer
26 views

Find grid cells in 2D grid based on object size and rotation

I am working on a game that uses a grid system that allows the player to place buildings in the world. Each cell in the grid is 64x64. All buildings will be a multiple of 64x64, so everything will ...
0
votes
0answers
23 views

2D engine design/architecture: transformations

Hello! I'm working on this hobby little 2D engine in JavaScript because I want to learn how all this things are implemented and architectured in general. Internet is full of resources but most things ...
0
votes
1answer
37 views

Collision Player and Tilemap Unity

i am a student in austria. I am working on a project for school, where we have to make our own first game with unity. Because it is the first time using unity, i constantly run against problems. Most ...
0
votes
0answers
20 views

Why is the color of my 8 bit drawing glitching everytime I export it into a png format

I am using Aesprite to draw my 2D 8-bit drawings and every time I export my drawing I always get this weird color glitch. How do I fix this?
0
votes
1answer
8 views

Using transform.position on an instantiated prefab in an array one by one

So I've been trying to make an already instantiated prefab to fall one by one in my scene. First they instantiate hidden in the camera and that works so far. But when I apply transform.position on ...
0
votes
1answer
23 views

Double jump, without allowing two jumps after falling down a cliff

I created a script that allows the player to double jump, which works like a charm. The problem is if the player walks off a cliff, they will still be able to jump twice. But that isn't how double ...
0
votes
0answers
12 views

Animation for some reason doesn't trigger after death

So I am trying to trigger this explosion animation after this enemy dies, but for some reason the animation doesn't trigger. I've made sure that the explosion animation is linked to "Any State", and ...
0
votes
0answers
26 views

Enemy destruction shows particle explosion but GameObject doesn't disappear?

So I want to make an enemy that self destructs after it collides with the player, but for some reason after the enemy collides with the player, it doesn't destruct and only plays the particles. In ...
0
votes
1answer
63 views

Topdown Game Collision Detection

I am working on a simple game with topdown movement, but I am unable to get the collisions to work properly. I know the collision detection itself works, but the constraining of the player is where I ...
0
votes
1answer
22 views

Why isn't my BoxCollider2D doing anything?

I'm trying to make a speech bubble appear when you approach the tutorial board. The bubble is there and it has its animation states "Appear" and "Disappear" Appear is called OnTriggerEnter2D ...
0
votes
0answers
23 views

Inheritance script works with one enemy, but not the other enemy for some reason

So I have created an inheritance script so that every enemy can have the same death properties, which are playing a death animation, then destroy itself. So I have one enemy that works, but the other ...
0
votes
1answer
35 views

How do you repeat 2D tiles in Java code when you go out of range?

I am looking up tutorials on how to make 2D games, and I can just copy and paste their code but I would rather know what it means and how to do it. Suppose you have a 2D game window that has a map ...
0
votes
0answers
36 views

How to create a procedural dungeon crawler like the binding of isaac? (javafx)

I want to create a procedural dungeon crawler map, like the binding of isaac. The aim is to connect multiple rooms in a 2D-array, where the player can traverse through. Each room will have doors, such ...
0
votes
1answer
94 views

What is the meaning of >> and & in this code context and what they are trying to accomplish?

I am following a tutorial on YouTube for making a 2D game. There is no clear explanation on what its actually doing. I get bit-shifting and & operator but I don't know what they mean in this ...
0
votes
0answers
9 views

Only initiate pathfinding when player is near [duplicate]

So I have made a code that allows pathfinding, with the help of astar. I followed brackeys tutorial on creating a pathfinding code, and manually (without the help of brackeys) added a code to only ...
0
votes
1answer
50 views

Is there a way to make the enemy start its pathfinding once the player is in a certain distance than the enemy

I am currently using A stars' pathfinding code here: https://arongranberg.com/astar/. So I didn't create any scripts, and used the scripts provided by astar. But the problem here is that even though ...
0
votes
0answers
24 views

Enemy does not switch to jumping and falling animation, and stays in idle the whole time

So I want my enemy to switch to jumping animation after it finishes its idle animation. So I named my movement script: void movement(), and create an event that references movement() at the end of the ...
0
votes
2answers
71 views

After the player collides with the enemy, it keeps moving backwards until it falls down a cliff

My player will basically be pushed back forever after colliding with an enemy. I have tried changing the mass of the player to like 100, but it still does the same thing. The force that pushes the ...
0
votes
1answer
115 views

The jumping height changes randomly, and it is not due to the fact that I press the space bar longer. It is just random

Sometimes, the jump height will be so high, and sometimes it jumps normally. How do I solve this? Code: ...
-1
votes
1answer
57 views

Player sometimes doesn't jump up while moving and jumping at the same time

My issue is that the player sometimes (occasionally) doesn't jump up while moving. It sometimes works, sometimes don't. It's weird, and I am not sure whether it's the code problem, or the tile ...
0
votes
0answers
28 views

Make 2d camera rotate around the player

I'm making a simple 2d javascript engine based on a scene graph (all game objects are containers whose children live inside their parent's coordinate space). My camera implementation works by setting ...
0
votes
1answer
56 views

How to animate fluid filling down a pipe of any shape?

I am working on a project where I want to model a simple flow of fluids around a circuit of pipe. I thought a simple way to do this would be to create an irregular shaped loading bar, then animating ...
0
votes
1answer
30 views

Box Collider 2Ds float just above each other in Unity

I'm learning 2D Unity and am experiencing a very strange problem. When I have 2 objects both with Box Collider 2D and a RigidBody2D, and one of them is set to be static so it doesn't move, the other ...
0
votes
1answer
75 views

How to select top most gameObject in a stack of gameObjects?

I'm stuck trying to figure out how I can select the top most GameObject in a stack of GameObjects. In the picture below, I have a Green and Yellow circle stacked on top of each other. If I try to ...
1
vote
1answer
74 views

Implications of variable run speeds in 2D

I'm getting my feet wet trying to design and implement a 2D action platforming game. Combat will be a big focus, so I want to have tight ground and air control so players can be precise and express ...
2
votes
1answer
82 views

How to load a separate map from a text file?

I have a text file that I am using for my map for the tiles to be allocated. This works fine, but I am running into issues figuring out how I would go about loading in a different part of the map. ...
0
votes
0answers
23 views

Platformer collision detection problem - player snapping onto sides [duplicate]

I am having problems with collision detection. I am trying to make a simple platformer but when the player is falling or moving too fast it sometimes detects the wrong collision side. I am getting the ...
0
votes
1answer
46 views

2-D character not falling to the ground

I am very new to Game Development and I am making a game with a simple Ragdoll which has a body, a head, and 2 limbs(hands). The head and the limbs are hinged to the body and I have kept the Ragdoll ...
0
votes
2answers
43 views

2d Raycast detection doesn't work

I want to check if the position I generated has another object or not. I do this by using Raycast: ...
1
vote
1answer
38 views

When setting Rigidbody.isKinematic true collider won't work anymore

I have a rigged 2D character and used Collider2D/Rigidbody2D/HingeJoint2D to body parts to implement ragdoll. It works fine, but I needed to run ragdoll physics only when character is dead. So I made ...
0
votes
0answers
28 views

“Force Quit pressed for Copying file failed” when dragging sprite into Unity

I just created a new project and am unable to add any sprites to the project. Any ideas on how to resolve this? My version is 2019.3.1f1 and i'm running on Linux.
0
votes
0answers
71 views

How should my artist create an isometric curved road?

My isometric game thus far has consisted of 64 x 32 tiles, but my artist has run into a few issues when drawing the tiles. Most of them look fine & have a seamless appearance, but there have been ...
49
votes
7answers
13k views

How do we convey scale in 2D games?

What methods can one use to let the player experience the size of a game world in a 2D game, be it Isometric or Orthogonal? When playing an open-world game in 3D, the player often is able to rotate ...
0
votes
2answers
96 views

Is it possible to detect a collision between a sprite and a UI image in Unity?

I have a stationary sprite with the tag "Player" with a Rigidbody2D (dynamic body type and discrete collision detection) and circle collider 2D. I also have a moving UI image; also with a Rigidbody2D ...
1
vote
0answers
48 views

How to place the origin of an isometric map at the top, not the left

I have an isometric diamond-shaped map. Currently my map origin is to the far left, instead of the top. The green circle at the top-center of the map is where I want the origin point to be, however ...
4
votes
4answers
332 views

How to give depth to a top-down shooter?

I'm working on a top-down shooter kind of game, but it lacks the feeling of depth. When you have a sun, it's a bit easier, because the sun can cast shadows. But it's even harder, when there is no sun,...
1
vote
2answers
35 views

Rotating 2D bone in LateUpdate have jittering issue

I made a skinned 2D character and applied IK to each hand and leg. In my game, player can aim up and down by moving fire joystick up and down. This is implemented by update "chest" bone's rotation in ...
0
votes
0answers
39 views

Why are my colliders offset on my isometric map?

I'm building an isometric environment in Unity and having some trouble with my colliders aligning with what shows in the scene editor to the reality in gameplay. There is nothing in the collider ...
0
votes
2answers
51 views

“Instantiate” function in Unity spawns enemy but it doesn't show up

So, I'm making a top down shooter (2D) and I already made an enemy prefab. It walks to the player and damages it, and reacts to bullets physically until it eventually dies. The prefab itself is ok, ...
0
votes
2answers
46 views

How to calculate the post Rigidbody2D velocity vector before applying a specific force in Unity?

I am trying to implement a space rocket in 2D. Whenever the player presses a button, a constant force (Both vertical and horizontal) is being added to that rocket. What I want to add is a maximum ...
2
votes
1answer
31 views

Player must places the object in the preset position

I want to know how to do like this video: https://youtu.be/6gouxqSxeG8 At the minute 3:09, the player can put the street vendor in the predetermined location (with the green arrow show that place). ...
0
votes
1answer
227 views

How to make animation in unity Dots hybrid?

I'm working on isometric game in 2D but didn't find any good tutorial in how to handle animation...any help?
0
votes
1answer
130 views

Can a GameObject be both 2D and 3D?

In all Unity games I saw so far, every object is either 2D (with RigidBody2D and Collider2D components), or 3D (with RigidBody and Collider components). This makes sense, but I wonder if there is any ...
0
votes
0answers
21 views

Unity: Spritesheet character with different independent animations

I want to be able to animate different parts of a character's body independently and I can't figure out how to do it. I have an animation for the head and another for the legs, made by multiple .png's ...
0
votes
2answers
127 views

Why are rotations in 2D game engines often counter-clockwise = positive systems?

I was looking over the API for a game engine a friend was developing in her spare time. She made the decision to make positive angles rotate in a clockwise direction. This immediately struck me as odd....
6
votes
0answers
207 views

How does a game like Enter the Gungeon handle forward and backwards movement with their orthographic set up?

So I've been scratching my head at this problem for over a week now, and would love some insight from anyone who might know a bit more. In my game I have the floor flat on the X/Z plane with walls/...
1
vote
0answers
29 views

Q: 2D cone and rectangle collision detection

I'm working on a 2D RPG game and now I need to detect if players ability collides with enemy rectangle hitbox. Currently I have this code that detects if a point is in cone, but I need to modify it to ...

1
2 3 4 5
60