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

How to position an Image atop a specific point on another Image?

I'm trying to update an older 2D game to run on Unity. One thing it does is place an overworld map with a bunch of icons that you can click on. I've set up a Canvas ...
0
votes
0answers
33 views

How can I make my Unity 2d scene pitch black, except for manually added lighting?

I have tried modifying all the settings suggested that I can find, but the lighting of objects in my Scene remains unchanged. I've used the "Generate" button, I've set "Intensity ...
1
vote
0answers
32 views

Pixel-perfect jitter-free motion

Here's a thing I cannot wrap my head around: When we are talking about low-resolution pixel art, there is a subcategory that deals with pixel perfection: Like in the olden days you are restricted to a ...
1
vote
1answer
47 views

How do I get the consistent time it would take for two points to reach each other in circular motion?

I'm making a 2D game. It involves the player swinging around a grapple hook in perfect circular motion, however, I want to make the cooldown for this ability based on predicted end position for the ...
0
votes
0answers
14 views

How do I distinguish a network of triangles connected by only 1 vertex as separate meshes?

I'm having trouble figuring out an algorithm to do this. It also seems to be very performance heavy potentially. I'm currently using Unity's Mesh component for this. In this example, I want triangles ...
0
votes
1answer
20 views

Need help with locking the Y axis on camera

I am working on a small 2D platformer in Unity for my school project and I would like to lock my camera on Y axis (so it can move horizontally, but when the character jumps it doesn't follow the jump)....
0
votes
0answers
22 views

Why is my blender 2D ring so pixelated when imported into Unity?

I created a simple ring in blender, yet when I import it into Unity it is horribly pixelated and choppy looking. I want the ring to look perfectly smooth. In blender, I selected the "shade ...
0
votes
2answers
71 views

Converting from global coordinates to local coordinates

I am trying to create a Radar/Minimap for the F1 2021 game in C#/WPF. Here is a image of what I am trying to replicate In the image, the white car (my car) will always face the direction it is going. ...
0
votes
1answer
38 views

Is a platform an entity in 2D Platform in ECS pattern?

I've been coding a small 2D platformer applying ECS pattern. However, I'm struggling with a issue. When building each platform from tilemap and such platforms need to be collided by other entities, ...
0
votes
0answers
52 views

How can I force my Navmesh agent to only move four directions? (for 2D)

I'm making a 2D game in Unity. For 2D I am using the NavmeshSurface2D-plus master package available on github. My enemy object is chasing my main character nicely, it's ok. I set my main character to ...
0
votes
1answer
35 views

How can I update the Navmesh path in 2D games?

There are destructible and indestructible objects on the map I created with Tilemap, and I create a walkable area (bake) for my enemy object using the information I found on the internet and the ...
0
votes
1answer
77 views

High CPU usage with Godot tilemap

I am using Godot as my game engine and I am making a basic 2D game, I have a small map with 1 Player and 5 Enemies walking around in it. The game includes some basic code for walking and shooting at ...
1
vote
3answers
101 views

Unity2D Grid-based Sprite Movement and Tilemap Collision

I have just started working with Unity2D to simply learn how it works. I've been trying to get grid-based movement and collision with a tilemap working, and it's mostly there, but there's one bit that'...
1
vote
0answers
55 views

Odd behaviour from parallax

First of all I'm going to say that I'm not trying to blow my own trumpet or anything but usually I'm able to figure this stuff out on my own. But as for now I'm fully stumped. Maybe I'm having a mind ...
0
votes
0answers
17 views

ACharacter falls instead of landing back at its starting point when jumping at the edge of a ledge

I’m using ACharacter class for a 2D platformer game in Unreal 4.26. When the pawn (the main character) starts to jump from a the very edge of a ledge, it’s not able to land in the same position. ...
0
votes
0answers
16 views

More smaller scripts or less larger in Unity 2d Development? Better or worse performance? [duplicate]

In my unity 2d game I had large amount of scripts which were components of different enemies and obstacles. All of them were checking for collison, had FixedUpdate, Start and OnCollisionEnter2D and ...
0
votes
0answers
38 views

Optimal data structure for managing AABBs to minimize collision check queries

Say I have thousands of 2D Axis-Aligned Bounding Boxes (AABBs), and a single point. I'm checking whether a point is inside a certain AABB before performing some expensive logic. ...
0
votes
0answers
50 views

character movment and physics on 2d game

I'm developing a client/server multiplayer game. in server side i need prevent players cross map objects like walls also i need prevent player go inside each others, instead want to slide them along ...
0
votes
1answer
79 views

Deriving shadow position from a 2D heightmap

I have a 2D heightmap with discrete values. Based on these values they should cast a fixed position shadow (constant angle respective to the "sun"). I can figure out how to cast it on a flat ...
0
votes
2answers
41 views

How to make windows that pick up what appears in the other

Basically there are 2 windows that you can drag and drop around the screen. Whatever appears in one window will also appear in the other. The two windows cannot go one over the other. This is a demo ...
1
vote
1answer
67 views

Cannot properly get 2D top-down tile-based collisions

I am using HTML, CSS, and plain JavaScript for a 2D top-down tile-based simulation. I am trying to do collisions in which, for example, if I move up and hit the ceiling collision tile, I cannot ...
0
votes
0answers
14 views

Struggling to get layer collision to work without stopping movement

I currently have my player object set with a dynamic rigidbody and a box collider, and the object I want it to collide with just has a box collider. The player is on the Player layer, and the object ...
0
votes
1answer
29 views

Does the Z axis matter at all in a 2D project, when using layer collision for all collision detection?

As I understand it, the Z axis is responsible for the rendering position of the object in relation to the camera/other objects, and layer collision only checks if an object collides based on the x/y ...
0
votes
1answer
41 views

How Can I Order The Scores List By Newest Added? Unity C#

I have 5 scripts to make the scoreboard. But I don't know how to order the list (the scores which are stores in a list) by newest added. Can someone please help me? Thanks :) First Script: ...
5
votes
2answers
103 views

2D topdown generating stairs (access) to generated hill

I'm doing 2d topdown procedurally generated world. I'm generating perlin height values, and when certain value is crossed I'm generating one level higher, while edging biomes creates cliff of the ...
1
vote
1answer
50 views

Having trouble implementing edge collapse operation with half-edge data structure

I'm trying to make a half-edge data structure to interact with meshes in 2D space in Unity but I'm having trouble with implementing an edge collapse operation that merges one vertex into its twin half-...
0
votes
0answers
19 views

What is the most efficient way to keep a vertex contained within a network of edges/vertices?

Given this picture, I want to move or displace the red vertex but I don't want it to pass the orange edge boundaries or the blue vertices. I either want to stop the red vertex when it gets close ...
0
votes
0answers
34 views

How would I determine the size / camera bounds of a staggered isometric map?

I am currently making an isometric 2D game, and the map grid is of the staggered-isometric type. I want to attempt to create the camera so that it stops at the end of the map bounds. Now I am fully ...
2
votes
1answer
46 views

Only Square Textures loading correctly (Beginner question)

(Sorry if this has already been asked, I couldn't find any other question or source describing my problem) Okay so basically Square textures load and display just fine. But for some reason, when ...
2
votes
1answer
556 views

Spritesheet with unstable width

I'm working on my 2d game engine using HTML5 and Canvas. I have a sprite sheet, and each frame of this sprite sheet has its own size. Considering that the Viewport is following this sprite sheet (in ...
-3
votes
1answer
61 views

Can anyone explain this code? C# Unity [closed]

Can someone explain this code to me? ...
0
votes
1answer
47 views

Determine when a character is stationary, and which direction they are facing

I'm currently trying to figure out two things for my character's movement and animation. A better/faster way to track when movement stops than the IsSleeping method. A way to track which direction my ...
0
votes
1answer
21 views

How to make a sprite face the mouse while remaining upright, without negative scale?

In the game I'm creating I have a sprite that needs to constantly be facing the mouse, but the sprite also always needs to be facing "up". Because of the Polygon Collider 2D and Shadow ...
4
votes
1answer
85 views

I want to cut a pizza slice out of a 2D circle using mouse input in Unity. What data structures and geometric formulas would be best for this?

I understand this is probably not an easy task considering I haven't found any code examples online that do something like this but if I wanted to take in mouse input lets say during a drag and use ...
1
vote
1answer
93 views

Pixelart loses quality when rotated in unity

Sorry, still fairly new to the game here but my pixel art gets little ridges on it when I rotate it in unity. I'd like the pixels to rotate all together. Is this just because I need to make my pixels &...
1
vote
0answers
49 views

How do I cut mesh partially with EzySlice?

I'm using the EzySlice framework to cut meshes (https://github.com/DavidArayan/ezy-slice). So far it can cut a mesh but infinitely but I want to be able to cut partially like this: As you see in the ...
0
votes
1answer
34 views

Overshooting when traversing between two points with a set velocity

I'm creating a prototype for something I may make into a game and I've run into difficulty in creating a method to move a ship along a line between two points. While it reaches the end point, it ...
1
vote
1answer
69 views

Find those points lying on a circle from a ton of points

Given a 2d scene and 10,000 players with coordinates in the scene, I want to implement a function, the input is a circle with the center coords and its radius, the output is those players that lie on ...
0
votes
0answers
20 views

custom 2D skeletal animation

I'd like to animate my 2D player by interpolating him between keyframes of joints/bones. He's to be very simple, just a chunky stickman outline of coordinates with no sprites. I want to make it all ...
1
vote
2answers
111 views

Shooting from Gun in LibGDX

I'm trying to shoot a bullet from the tip of a gun. This gun is a Sprite object and it is constantly being rotated to point towards the mouse. The issue is that the point to shoot the bullet from is ...
0
votes
1answer
90 views

How do I make an object bounce off the wall?

I am spawning objects at a random place at the top of the screen, tilted at a random angle like this: ...
0
votes
1answer
35 views

How to recreate a comic book panel transition with my canvas (simple 2D background art)?

https://www.youtube.com/watch?v=Tqqf5Y8LyR8&t=23s&ab_channel=ErikLoyer So I want to achieve a transition like from the above video, specifically at 0:23 the TRACK, but there is a 3 Dimensional ...
0
votes
0answers
51 views

match-3 Board border

I'm new to unity and I'm currently working on a match-3 game. I know there are a lot of similar games and that's why I would like to know what is the best way to autogenerate border of a match-3 board ...
1
vote
1answer
100 views

How do I carve rooms and corridors into my map to connect exits placed at the edges?

I'm creating an adventure/RPG top down game where the map is randomly generated divided into zones. A major problem I'm having trouble figuring out is creating exits placed at the edges. The game is ...
-1
votes
1answer
53 views

How to make environment art like the building interiors in Digimon World 3 [closed]

I'm wondering how to create art like this (the map, not the characters), is this 2D or 3D?
0
votes
0answers
75 views

why is my grappling hook pushing me when i flip the character in godot

When i flip the character and use the grappling hook it pushes me away from the grappling hook and not toward. player.gd ...
1
vote
1answer
20 views

Odd behaviour when changing rigid body velocity inside OnCollisionEnter2D

This is the code I'm using to make an object bounce across the scene: ...
2
votes
2answers
223 views

How to use different drag values for the X and Y axes on a Rigidbody2D?

I'm building a small 2D character controller using Unity physics to simulate an oldschool platformer. I know this is not the best way to do it and I have my own version using just raycast and custom ...
0
votes
0answers
41 views

2D Top Down Follow Camera Stuttering

I am making a top down pixel art game and am using a simple follow script for my camera. ...
0
votes
2answers
88 views

Help with multiple powerup types

I am trying to have a single class that handles multiple powerups types and using enum for the types of power-ups and switching the powers based on enum however when there are multiple power-ups in ...

1
2 3 4 5
66