Skip to main content
The 2024 Developer Survey results are live! See the results

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
2 answers
65 views

Limiting number of Game Object

So I have this script that summons a stationary laser that the player is supposed to not get hit by, but since there's multiple game object with the code and they can all trigger at making it ...
Matt Sou's user avatar
0 votes
1 answer
101 views

Randomized bullet shooting bullet hell

So I'm making a bullet hell game and I have script for a basic bullet to spawn and shoot towards the player, but it's always at set intervals and I want it to be random, but I dont know how. I tried ...
Matt Sou's user avatar
1 vote
1 answer
44 views

Object moves continuously and won't stop until it hits an obstacle

So im fairly new to coding and don't know much and so I decide to improve this line of code I had before, by finding something online and now my object is constantly moving and won't stop unless it ...
Matt Sou's user avatar
0 votes
0 answers
26 views

2d top down movement physics: speed, max speed, acceleration, friction, velocity, delta

I am creating a 2d top down game and am trying to implement movement. My current approach is very simple and looks like this ...
Aeon's user avatar
  • 1
0 votes
1 answer
195 views

Tethering Two GameObjects Together By a Rope Through Code

What I need assistance with: I need to create a rope connecting two GameObjects together at runtime through code. One end will be connected to Transform _pointA ...
PayasoPrince's user avatar
2 votes
1 answer
397 views

2D Pathfinding with rope constraint

I have a character linked by a rope to a fixed point, in an environment with obstacles. I want to do a pathfind that take into account the rope. Here, if the character followed my current pathfind in ...
Alikae's user avatar
  • 51
0 votes
0 answers
32 views

Even after changing Default Behaviour Mode to 3D, my scene still remains in 2D. Why?

I had created a new scene, which didn't have sky and directional light. To solve this, I created a new skybox, then added to the maincamera. But there was no difference to scene & game view. ...
Minchae KWAK 12HSC's user avatar
0 votes
1 answer
73 views

My Godot 4 2D game is running badly on HTML5 on some PCs

using Godot 4.2.1, My game is a pretty simple top down shooter, I tried exporting to HTML5 on itch.io and the game runs fine on certain PCs but not others ?... when running the game on my computer ...
buzzbuzz20xx's user avatar
0 votes
2 answers
50 views

2D drag and drop dynamic rigid body spinning out of control in Unity

I'm trying to make a 2d game that involves dragging and dropping certain dynamic physics objects (like squares) and I am a beginner. I need it to look like the rest of the object holds a weight when ...
Kareem Shamma's user avatar
0 votes
0 answers
34 views

How can I instantiate an object on all tiles of a hexagonal tilemap?

On startup, I want to instantiate a text object on each tile (displaying its info). How can I accomplish this for a hexagonal tilemap? Here's my poorly written code that doesn't work. It seems to ...
Alyssa's user avatar
  • 1
0 votes
0 answers
29 views

Inconsistent results from ApplyCentralImpulse with RigidBody2D

I'm working on a 2D top-down game using RigidBody2D for the player and enemies. They're bouncing and moving (using ApplyCentralForce) and detecting collisions just fine, however now I want to add a ...
Bryan Johnson's user avatar
2 votes
0 answers
64 views

How to make enemies navigate around each other in a grid-based game?

I am making a 2D top-down grid-based game where the movement is similar to older Pokémon games so it's locked to a grid. I implemented A* pathfinding for my enemies with a bool[,] that indicates ...
rossz97's user avatar
  • 21
0 votes
1 answer
38 views

2D orbit an orbiting body without ellipse

I have a monster (boss) that spawns a minion (m1) which orbits the boss. m1 can spawn its own minion (m2) which orbits m1. This creates a situation where m2 is orbiting m1 and m1 is orbiting the boss. ...
gabriel__'s user avatar
1 vote
0 answers
144 views

making a 5 minute Metroidvania prototype and wanna know if my dev process is good

I've been learning Godot and game dev as a whole since the start of this year and I've sunk dozens of hours into practicing making games in it, lately I've set out to make a very small sort of "...
buzzbuzz20xx's user avatar
0 votes
1 answer
199 views

adding a knockback effect to a CharacterBody2D in Godot 4.2.1?

i was following a tutorial series on YouTube on creating a Zelda clone in Godot 4.2.1 and everything works fine, but the tutorial never implements a knock-back effect when attacking an enemy so i ...
buzzbuzz20xx's user avatar
0 votes
0 answers
17 views

How to update a component field for a single player for all player views?

I'm making a 2 player game in which, when 2 players are in a room, they "toss a coin" to decide which of the two player "skins" they get. Now, the way I built the player "...
Kaiannae's user avatar
  • 113
1 vote
1 answer
103 views

How do I compose RPG character with different equipment?

I wonder which technique is used to render 2D RPG character with different armor pieces and weapons. E.g. character can equip different chest armors, gloves, boots and helmets. They also can equip ...
Steyrix's user avatar
  • 225
0 votes
0 answers
29 views

2D Physics inconsistent across platforms

I want to create a black hole like gravity pull effect in Unity2D, and used that code for this: ...
CheckerT's user avatar
0 votes
0 answers
42 views

Line Of Sight in javascript DOM game

I am creating a 2D game in javascript using pure DOM, on my computer and on my cell phone WebGL or OpenGL do not work. How can I create Lights and shadows effects using Line Of Sight, for example, I ...
Haruki Hotarou's user avatar
0 votes
1 answer
53 views

Moment of inertia of an arbitrary grid of squares with different masses

I'm making a game where the player can create a 2D spaceship, one square "tile" at a time. In order to simulate the kinematics of the ship I need : To compute the CoM vector. That's easy ...
user29223's user avatar
0 votes
0 answers
32 views

Matrix parent-child transformation for 2D positioning

I am working with matrix math for parent / child transformations. I have to modify existing calculations to keep child scale constant while also keeping child position relative to its parent. Here's ...
Karli Casper's user avatar
0 votes
1 answer
47 views

How to make a ball always bounce like in the game One More Bounce using Box2D?

I'm coding a game with Flutter and the flame_forge2d package (which uses Box2D internally). I want to make a game whose principle is similar to that of the game One More Bounce (a game where you have ...
Alex Irié's user avatar
-1 votes
1 answer
90 views

How to make a 2D Procedural Track Generation Algorithm

I would like to create an algorithm that generates a random track that a car can race on. How would I best go about such an algorithm? I will be using Unity 2D, but for my project I require using an ...
Techwizard's user avatar
0 votes
0 answers
18 views

Can I extract/bake the collisions generated by a tilemap collider?

Given a tilemap, with a tilemap collider, is it possible to extract/bake the current collision(s) onto a separate gameobject independent from the tilemap/tilemap collider? My 2D game streams a large ...
Saturn's user avatar
  • 1,753
0 votes
1 answer
59 views

How can I make a camera follow an instantiated object at runtime?

I have an object meant to represent a player that I'd like to spawn in at runtime. Because it is instantiated at runtime, I'm not sure about how to get the main camera in my scene to follow the ...
NJJ_002's user avatar
  • 47
0 votes
0 answers
55 views

How to make this soft sphere with Unity?

What methods should be used to create such a sphere in UNITY? This collider seems to deform in real-time, squeezing and monitoring collision information when the sphere collides. I cannot achieve this ...
asd's user avatar
  • 1
0 votes
0 answers
26 views

Springy / Stretchy rope

I have a 2D rope cutting game similar to cut the rope, and I want to add ropes that can be extended further than if it laid flat. Easy said: I want to stretch the rope. Currently I have a parent game ...
CheckerT's user avatar
1 vote
0 answers
88 views

What exerts a force on my rigidbody?

I'm trying to create a simple 2D scene with two rigidbodies, which are connected by two pin joints. There is one large rigidbody, a green circle, which is slowly rotating at a constant speed (as its <...
F-H's user avatar
  • 111
0 votes
0 answers
35 views

Collision manifold between shapes

I am implementing the narrow phase collision detection of a 2d physics engine. The narrow phase takes a list of shape pairs: [(s1, s2), (s2, s5), ...] And for each ...
Eilan Laken's user avatar
1 vote
2 answers
74 views

Representing a concave polygon as a hull "minus" convex cavities

I am implementing 2D collision detection, and trying to tackle the problem of concave polygon vs. shape. The SAT works only for convex shapes. I was wondering if the following approach is a viable ...
Eilan Laken's user avatar
0 votes
1 answer
34 views

How do I move both the child & parent game objects at the same time?

My current code is: ...
Saltii's user avatar
  • 1
0 votes
1 answer
63 views

Circle to Polygon & Circle to Circle Velocity Resolution

I am working a 2d physics engine. Polygon to polygon collision and velocity resolution works without issue, but I am struggling to get working circle to circle and circle to polygon velocity working ...
TrippR's user avatar
  • 3
1 vote
2 answers
58 views

Different Spacing of all Children Grid Layout Group

I am creating a top down 2D game, and I am creating randomized triangles on the ground. Such as this: This is to enhance the "knowledge" that you are moving. But it certainly doesn't look ...
sammyiscuul's user avatar
1 vote
1 answer
70 views

Tiled Map in Unity is Darker than in Tiled Editor

I have a problem rendering a Tiled Map in Unity (.tmx format): the Tiled Map is darker in Unity than in Tiled Editor. I tried to change properties but got same ...
Resorter's user avatar
1 vote
1 answer
79 views

Get Impulse force needed for parabolic projectile launch

I want to create a projectile that fires upwards and in a sense falls down onto the player, like this: I found through some research I needed to use a "parabolic" equation. However it wasnt ...
Pow's user avatar
  • 404
2 votes
1 answer
700 views

Creating a new camera in 2D mode sets it as default, despite not being the main camera

I created a new camera in Unity's 2D mode, and for some reason it's being set as the main camera, despite not being tagged as such. The original main camera is in fact tagged as "main camera"...
Jimbojaggi's user avatar
2 votes
3 answers
142 views

Performance issues with high-resolution maps in 2D strategy games

I'm currently developing a 2D strategy game, and I've encountered some issues with the game map. My idea is to use a single 2D image as the strategic map for the game. similar to this (Supremacy 1914) ...
NoPyDeal's user avatar
1 vote
1 answer
81 views

Issue with AttackArea Monitoring Before Attack in Godot 2D Game

I'm developing a 2D game where the player character can attack enemies using a designated attack area (Area2D node named AttackArea). I've encountered a problem where the AttackArea is active and ...
buzzbuzz20xx's user avatar
0 votes
2 answers
112 views

Max velocity for smooth deceleration to destination

I am able to update velocity of my agent every 0.5 seconds. My agents max speed is 5f/s and max acceleration/deceleration is 2f/s. I know how far away I am from the destination. How to determine ...
Peter's user avatar
  • 13
1 vote
0 answers
37 views

Stop Jitter On Rigidbody2D From Rotation

I'm currently working on a geometry dash like game, except it is a triangle instead of a square (rubrub calls it a cube). I want it so that it rotates back to 0, 0, 0, when it is touching the ground. ...
sammyiscuul's user avatar
0 votes
0 answers
33 views

Help with 2D Pixel art sizing in unity

I just got into making a pixel art platformer for fun and I wanted it to work so that I could have a scrolling parallax background and also a tile set for the actual level to be played on. I ...
Aiden's user avatar
  • 1
1 vote
0 answers
21 views

Is it possible to always make a trail crossing another trail on top in unity?

I have a couple objects with trail renderers. I was wondering if it was possible to make it so that when an object passes over the trail of another object, it always appears on top ? Because right now ...
Usylom's user avatar
  • 21
1 vote
0 answers
749 views

Y-Sorting in 2D Isometric Games in Godot 4.x

I am having a problem with Y-sorting in an isometric Godot game. More specifically, when my character moves behind/in front of larger objects than one standard tile size, the rendering is inconsistent....
Gergely Kovacs's user avatar
1 vote
1 answer
155 views

Curved Grid Layout Group

I can't find a quick answer anywhere, besides adding a 100 line script that I'm pretty sure is outdated. As the title suggests, I am trying to curve a grid layout group. I also want the children of ...
sammyiscuul's user avatar
0 votes
2 answers
39 views

Trouble setting camera position in Unity

I'm attempting to set the camera position in Unity through code. I have a simple 2D game and there's not much programming so far. I've attached a script to the camera, and in that script I've added ...
Nightmare Games's user avatar
0 votes
0 answers
32 views

Physics Material 2D Not Working When Object Rotating Around Player

I am trying to make a clone of florr.io (I'm not getting sued I know what I'm doing), assuming you don't know what that is, it is a game with petals rotating around you. I'm using a parent object ...
sammyiscuul's user avatar
0 votes
0 answers
56 views

How to align to 2D ground surface directly underneath?

I'm out of ideas at this point. I'm trying to set up a function inside my player controller that aligns the player with whatever is under it (usually the ground), ive tried using Raycasts, collisions ...
Pow's user avatar
  • 404
1 vote
0 answers
98 views

How to enable undo functionality in a custom Unity inspector?

I'm working on a custom inspector/editor for my player controller, the issue is every time I change something and click undo, the undo just undoes clicking on the object not modifying the value. After ...
Pow's user avatar
  • 404
0 votes
0 answers
29 views

Materials on 2D Objects Has Bad Lighting and Changes Shape

Whenever I assign a material on an object in 2D unity, it becomes much darker and if the material is assigned to a circle, the circle becomes a dodecagon. The material is completely white. I can fix ...
sammyiscuul's user avatar
0 votes
2 answers
72 views

How to make a character fall through a BoxCollider2D?

Currently trying to make a 2D game in Unity and I'm trying to make the part where if the character falls in a hole it goes back to spawn, but I currently have a ground box collider blocking it, which ...
TheEpikDuck's user avatar

1
2 3 4 5
71