Questions tagged [2d]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
42 views

Object stuck against an obstacle still pushes other objects away

I have an object pinned against the ground by a revolute joint. A motor on the joint makes the object spin. Sometimes the object becomes stuck pushing against a static body. When it happens the object ...
0
votes
0answers
28 views

Having problems with mouse drag mesh vertex deformation in 2D

This is in 2D space. I want to create a mouse dragging mechanic like the one shown in the picture where I find a range of vertices relative to the position I first clicked where the red vertices have ...
1
vote
1answer
95 views

Generating consistent terrain chunks with unpredictable per-chunk seeds

I am working on an automatically generated (theoretically) infinite 2D world. The grid would be separated in chunks made of thousands of world tiles. We plan to use a Perlin noise function to generate ...
0
votes
1answer
20 views

How can I make a button active when all the items of my array have been displayed? (for a dialogue scene)

I've coded something in Unity using C# (see below) for a dialogue scene separate from the actual game. On the click of a button from the game, the player is taken to this dialogue scene where the ...
1
vote
1answer
40 views

How to prevent GameObject from moving?

I am making a pong game and here's the problem. The ball hits the enemy paddle and instead of reflecting the ball just takes the paddle with it. Ball Brains - ...
0
votes
0answers
17 views

Help with arrowmechanism

...
1
vote
2answers
119 views

How to blend a 2D terrain

Rimworld (shown above) has many different terrain types. In order to achieve Rimworld styled terrain, I need to achieve two goals A) How to render differently textured terrains B) How to blend these ...
0
votes
0answers
29 views

Using UI buttons for Input Manager

My character is supposed to be moved by 4-directional joystick. Until today I was using basic Input Manager for handling this from keyboard. I mean Horizontal and Vertical Axis. How can I make it so ...
0
votes
1answer
41 views

How do I find the correct vectors perpendicular to a vector in between two vertices?

I'm trying to push the purple vertices inward by moving it with a vector perpendicular to the red vector shown in the picture. Each directional vector created will move its respective vertex towards ...
2
votes
1answer
60 views

Detecting Surrounding GameObjects

Some Background Context: So I have a 2D prototype in Unity I am working on that has enemy entities that have rigidbody2D component set as dynamic as I am using physics (...
0
votes
0answers
36 views

Why my output image is not seamless?

I offset a region of an image but when I tried to restore it using same method it doesn't look right. here is my input and output: And this is the code I used to restore : ...
0
votes
1answer
73 views

Find Largest Room in 2d World

I'm currently working on a generated(Perlin Noise) 2D Cave System with Unity. The Caves currently look like this: What I want to do is spawn the Player (and other stuff) in the big Part of the Cave ...
0
votes
1answer
58 views

How do I make my obstacles (separate prefabs) appear randomly in the world?

I am using Unity in C# to code a game similar to Google's Dinosaur Run where random obstacles are spawned in the player's path which they need to jump to dodge. I have 6 different prefabs (with ...
0
votes
1answer
22 views

Drawing multiple simulation ticks in a single render frame

I have a 2D fixed-timestep simulation (a bunch of moving sprites) that ticks several times per render frame. I would like to render the state of each tick, so that all the ticks between render frames ...
0
votes
1answer
41 views
0
votes
0answers
19 views

Rigibody2D remove push-power

I have a player's prefab. The game is online, so when the player joins I place this prefab on the map. There are other players on the map. The player himself is controlled by Rigibody2D component ...
0
votes
0answers
26 views

How do you make a Unity 2D ball roll down a LineRenderer EdgeCollider2D incline?

How do you roll a 2D Image sprit ball using just the Unity builtin physics components on linerenderers with EdgeCollider2Ds? Tested my setup to work with physics. And PhysicMaterial2D so it bounces ...
0
votes
1answer
43 views

How do I convert 2d character rigging animation to frame by frame sprite animation?

In this video after about the 8th minute, he says he converted them from character rigged animation to the frame by frame animation, so I searched but couldn't find any answers on google. How do I ...
0
votes
0answers
5 views

Stationary touches detected in inspector but not in the build

I want my game to detect when I touch and hold. The touch works both in the editor on my phone (with unity remote) and in the apk build. The touch hold only works in the editor when I play on my phone....
1
vote
0answers
22 views

How can I draw a partial circle with LineRenderer?

I'm using the following code, which I found online, to draw a circle with a predefined radius centred on a predefined point in LineRenderer (2D game). ...
0
votes
0answers
77 views

How to make a shadow-casting day/night system in 2D URP?

I am trying to achieve a day/night lighting system similar to the game RimWorld. Short preview of what I want can be seen here: https://giphy.com/gifs/VgzcwtjueP7BrYSrXe Instead of using Global Light ...
0
votes
0answers
43 views

HUGE 2D worlds in Unity (like spaceflight simulator)

I am a beginner in the field of game development and I am having some doubts regarding some stuff... I am trying to build a 2D space-rocket-orbit game like the Spaceflight Simulator and I'm not able ...
0
votes
1answer
49 views

Two players using touch control simultaneously

I am working on a game like soccer star and I made a controller using YouTube and stuff. I added two players in the same scene and put this script on them. But when I play with player 1, then player 2 ...
0
votes
0answers
29 views

Circular Z ordering problem

I am creating a day-night cycle for my 2D side scrolling game and I have a big problem. The problem can be best understood if you look at the following image: Problem is very simple: the moon should ...
0
votes
0answers
28 views

2D side-scroller : how to place structures in a noise generated map?

I'm creating a little terraria-like 2D side-scroller game with TypeScript. The map is generated by a 1D noise which indicates the height of the ground at each block. I am looking for the best way to ...
8
votes
4answers
4k views

How to determine if a 2D image represents what player sees in 3D game world?

I'm working on a game idea where the player is shown a 2D image (say, a "photo") and the player must find a spot in a 3D world where the view is about equivalent to that photo - not ...
1
vote
0answers
61 views

2D Armor/Weapon System (Paperdolling)

I´m currently working on a 2D RPG where you should be able to compose your character from diffrent armor/weapon parts. For example the character can wear a "wooden helmet" and a "chain ...
2
votes
0answers
54 views

2D game make precise collisions

I am currently creating a personal 2D tile map game in Java. This is the first time I have attempted to make any sort of game, so I don't have a lot of techniques known by experienced developers. ...
0
votes
1answer
80 views

How would I incorporate gravity and gravity affecting obstacles into A* pathfinding in a 2d side-scrolling game?

I want to be able to modify the A* pathfinding in a way that I can get my NPC from his current position to any point that's within reach. The tricky part is that this takes place in a side-scrolling ...
0
votes
1answer
37 views

Sprite transparency fails when rendered through shader

I am currently trying to implement a shader to a sprite of mine, but the transparency is completely removed when the texture goes through a Sample Texture 2D node. The sprite under the Sample Texture ...
-3
votes
2answers
99 views

Better use background chromas or transparency?

For png 2D sprites, its better use chromas or alpha channel? What is more performant during run-time processing? What uses less storage? Any difference between ...
1
vote
0answers
78 views

Which algorithms to use for drawing procedural paint splatters?

I want to create procedural paint splatters on textures. I want somewhat similar effect like in Splatoon 2. I think I need to modify albedo image - drawing splatters there. Right now I came up with ...
1
vote
1answer
24 views

A concise set of equation of physics that handles basic 2d physics for acceleration?

I am making an Asteroids clone and I want to implement proper physics for the objects. What equations would I use to calculate the acceleration? For example, I have a ship, and it might have ...
0
votes
1answer
68 views

Issues using Physics2D.Linecast for Movement Collision

It's quite possible I'm missing something obvious (I'm still rather new to this) despite checking the documentation, but I'm at my wit's end with this issue. I'm attempting to add simple linecast ...
0
votes
1answer
103 views

2D side-scroller game : smooth noise transition between biomes

I'm creating a little terraria-like 2D side-scroller game with TypeScript. Currently, I divide parts of the world into biomes, which each have their own properties (flat, mountainous terrain, etc.). I ...
2
votes
1answer
148 views

Floats vs. Ints for position and collision

So I’m writing a player class and using floats to store the positon and velocity (Vector2) as well as using it when drawing. When it comes to collision I get the player bounds using this code: ...
0
votes
0answers
26 views

How to add level-by-level game camera following in 2D java game?

I've been working on my first game recently, and I've built a player tracking camera that works great, but my goal for the game would be to have a camera that is fixed for each area that the player ...
1
vote
0answers
69 views

Simple Unity 2d pixel art animation - Why is my sprite distorted and moved to the right when animated?

Need some help w/ weird problem during basic 2d animation. I have the following hierarchy: Where ritual is animated to translate deerhead up and down, shift color of pentagram, and pentagram is ...
0
votes
0answers
30 views

How to update multiple sprites

I have a game, with multiple sprites for a player. It includes animations and etc. Player can walk, kick, defend, be hit, etc. Now I developed new sprites to substitute the old ones. One way to change ...
0
votes
1answer
206 views

Why is my UI not working on android but works perfectly on PC?

I tested my game for the first time on mobile and the UI almost doesn't work. I use if(!EventSystem.current.IsPointerOverGameObject()) to check if I'm clicking on ...
0
votes
1answer
28 views

text - part of the sprite or dynamically generated

I am trying to reproduce the same stamping tool as the one we found in the video game "Papers, Please". In my case I want my users to be able to modify the text they are going to stamp. I ...
0
votes
0answers
17 views

How to ensure that a randomly-generated velocity vector moves the camera forward within a valid arc?

I spawn a camera in a scene using random coordinates for x and y and setting z=0 and orient ...
0
votes
0answers
64 views

How to mask 2D tile sprites

I want to use masking technique to be able to reuse tiles. Basically I have the base texture and an array of masking textures for different corners and positions and want to combine the two to get a ...
1
vote
1answer
184 views

Godot cutout animation with skeletons and ragdoll physics

i'm following the tutorial for cutout animation, but also wanted to combine ragdoll physics from this video, my goal is to make a 2d fight game with this 2 techniques. but not sure how to combine them ...
0
votes
0answers
31 views

Platforms are gradually being spawned further and further away in the Z-axis in a 2D Endless runner game, until they spawn behind the camera

I am creating a 2D endless runner game, where new platforms get spawned when the player reaches a certain distance to the last platform spawned. The issue that I found was that after the player ...
2
votes
1answer
71 views

How to manage a lot of items on conveyors

I am making some sort of factory game (topdown 2D) where I will have machines outputting items on conveyors. I was wondering what was the best approach to manage the items on the conveyors. There are ...
0
votes
2answers
73 views

2D - How to make a gun muzzle aim at the mouse when the rotation pivot isn't on the muzzle?

I'm making a simple 2D shooter game in pygame and I've come across an issue when making the character aim its gun at the mouse. To make the gun aim up and down, I've set it so that the gun uses the ...
1
vote
1answer
84 views

2D vs 3D mobile power consumption in Unity [closed]

For an optimised and playable game written for mobile with Unity, how much of a difference is there in power consumption between 2D and 3D? Assuming: Unity game engine The game requires constant ...
0
votes
0answers
51 views

How to check what tile the player is standing on?

My goal here is to write a check of some sort in my playerMovement script so that I can check the name of the tile the that the bottom-middle of the sprite is located in on the tile map, from there I ...
0
votes
0answers
19 views

Sprite sorting is working fine but tilemap sorting is working the opposite way I want it to [duplicate]

I provided some screenshots to display what I'm talking about. The blue tile is a sprite, and the bushes are made from tilemap, each being 4 16x16 tiles. My transparency sort axis is set to 0,1,0. I'...

1
2
3 4 5
66