3,098 questions
0
votes
0
answers
24
views
why is my SpriteKit collision detection not working properly?
I am making a SpriteKit platformer game and I am trying to get the collision detection working. so far I have written this code to detect when the player hits a tiles physics body:
func didBegin(_ ...
-1
votes
1
answer
57
views
function name collides with function in windows.h [duplicate]
Porting a library of my own making from Macintosh to Windows, it looks like I've bumped up against a predefined symbol in Windows:
[build] In file included from C:/msys64/mingw64/include/windows.h:72,
...
-1
votes
1
answer
38
views
Collision detection issue with entity speed in 2D Top-Down RPG Game
I’m working on a 2D Top-Down RPG and facing an issue with my collision detection. I have two classes: Entity.java and CollisionManager.java.
The Entity class contains attributes like speed and a ...
0
votes
1
answer
98
views
Godot Mesh Create Collision shape: Mesh is empty
I have a very basic mesh imported for this example. I just resized the default blender cube to a more plane-like structure and exported it into glb and then imported it in Godot.
In Godot, I created a ...
0
votes
1
answer
42
views
Matter.js - Handling collisions at high object speeds in matter.js
I'm currently working on a space flight simulator using matter.js as a game engine. I'm facing a problem with the huge size of the map. If we consider that 1 metre is 10px (adjusted to the size of ...
1
vote
3
answers
51
views
Why does my dragging logic in Unity not work? (only once)
I have a script attached to a GameObject with a Collider2D attached to it as well.
The script should enable me to drag the GameObject while holding down the mouse and "dropping" it by simply ...
5
votes
1
answer
179
views
After a bounce, compute the next time of impact between an inflating ball and a line of a polygon (and where it will hit)
Imagine a scenario with a ball that is inside of a closed polygon (made up of individual lines). The polygon is not necessarily convex.
The ball starts off at the centroid of the polygon with a ...
1
vote
1
answer
55
views
How to make a collision that works with rotation?
I have a problem because - if I rotate the block collision is still a box. I want to make hit boxes rotated too but I don't know what to do.
Also I don't use import in libraries.
Here is my code to ...
1
vote
1
answer
41
views
Mapping without collisions
This is abstracting the actual problem so it makes easier to understand (hopefully).
I have 1000 cards. Each card has between 1 and 6 pictures of fruit. There are 20 possible fruits. Examples: one ...
0
votes
1
answer
48
views
Ignore collision between parent objects in order to detect collision between its child game objects
If weapon collided with the body deal damage, if weapon collided with other weapon do not deal damage.
Problem is that when two weapons collide it detects it as if Player object and Goblin object ...
0
votes
0
answers
28
views
Stopping the shape from moving directly past a wall when checking for a collision [duplicate]
So I am attempting to program a physics simulation in Pygame and am having trouble adding solidity to the walls. As of now, I have only programmed solidity for the left wall, and the squares do ...
0
votes
1
answer
58
views
I have interesting bug with collision detection, where the player speed is doubled when they go down and collision doesn't detect
I'm programming a top-down 2d game in Java with 8 directional movements, and while writing my next big advancement which is collision detection I've run into a major bug. As described in the question ...
0
votes
0
answers
31
views
Debugging 2D elastic collision code in Julia
I'm trying to write what should be, in principle, a relatively straight forward project: a program that deals with elastic collisions between particles in 2D, that then creates a movie of the scene ...
0
votes
0
answers
20
views
How do I set up collision criteria in SMFL between CircleShape objects using object attributes?
I am implementing the simple game "Connect Four" and want to detect the presence of a stationary disc immediately below a falling disc as criteria for the falling disc to stop.
I am using ...
1
vote
1
answer
49
views
C# how to loop through a shared property of multiple static classes
im currently developing a simple console game and i've been stuck on how to implement the collision properly. when the player collides with an object, something should happen (for example, if the ...
0
votes
1
answer
89
views
Easiest way to shoot and kill an enemy?
I would like an easy way to be able to shoot an enemy and eliminate them from the scene this is what i did. is there any other way?
public class SpawnBullet : MonoBehaviour
{
public GameObject ...
0
votes
0
answers
74
views
ThreeJS hitbox manipulation
Very new here, apologies if this is super basic.
I have a sphere. I want to:
Be able to create zones on the mesh. So at a start there will be one zone completely around the mesh. This is essentially ...
0
votes
0
answers
43
views
Slowdown in 2D tile based platformer
I'm trying to make a 2D tile based platformer in monogame. In fulscreen mode, when too many tiles are on screen the frame rate goes down and the game is moving slow. I don't know what causes these ...
1
vote
1
answer
126
views
Godot4. How to detect collisions ONLY by the first iteration
I have the following problem in Godot Engine: How to detect collisions only the first iteration when Node2D enters the tree?
I'm using Area2D which is 💥 "Explosion" in my game and it has to ...
1
vote
1
answer
68
views
How to control the order of collisions in Unity 2D?
I'm making a 2D platformer with player mechanics that depend on the type of tile the Player lands on. I have two types of tiles white and black - if Player lands on a white tile, he has ability A, and ...
0
votes
0
answers
55
views
3D Collision detection between two objects in Javascript
I am trying to build a 3d game engine, and with it comes a 3d collision system to check whether an object intersects with another. I've tried implementing a function to check for collision however, ...
1
vote
0
answers
34
views
Collision not working properly between rects in Pygame [duplicate]
I have a variable, colliding, that should check if two rects are colliding. The collision works fine most of the time, but when trying to check if the rects are NOT colliding, the if statement passes ...
1
vote
1
answer
179
views
Unity Terrain - Checking if Player is touching Terrain?
I'm making a Unity Jump and Run Game and I want to check if player touches the Terrain ground. If so, I want to make something. My Player has a Character Controller. I already tried OnCollisionEnter ...
0
votes
0
answers
35
views
Car collision test per directed graph edge
I am looking to optimize a collision detection algorithm for cars on the road (preventing a car behind another from crashing into it). Without taking into account intersections.
Consider a directed ...
0
votes
0
answers
29
views
Godot collision issue
So, I'm making a slime game in Godot 4.2, and the issue is that the soft body is falling through the floor like a water droplet. You may edit it.
Here's the project. (Yes, I did intercept the requests ...
0
votes
3
answers
196
views
Unity Physics Collisions Happening Despite Being Disabled in Collision Matrix
I've got a weird issue in my game where a collision is happening DESPITE that specific interaction between the two layers being disabled in the Collision Matrix (images attached).
The Projectile is ...
0
votes
1
answer
119
views
Godot - how do I create a trigger zone?
For my 3d game on Godot 4.1, I want to create a dialogue and move to the next level when touching the trigger zone. Can you tell me how to do this?
The bottom line is that the player approaches the ...
0
votes
0
answers
25
views
How can i drag all scene in godot engine 3.5.3
I have scene with Paddle, which contains sprite and collisionshape, i need to hold finger on paddle and drag it on y axis in mobile app, what should i do so?
extends KinematicBody2D
var is_dragging = ...
1
vote
1
answer
51
views
React how to change two states In a way the don't collide?
Explaination of code : I have a two states toggleMenu and currentImageIndex(which changes every 2 second rerendring the image in browser) with images constant.
whenever I try to toggle menu if the ...
1
vote
1
answer
47
views
How to turn off collision impulse box2D LibGDX
I have an enemy and a bullet objects, when bullet hits an enemy it disappears but is also cause some impulse to an emeny model. This impulse is small but noticeable.
I tried to set enemy velocity to ...
0
votes
1
answer
47
views
how to perform an object delete when contact happens Box2D LibGDX
I'm trying to process a collision between a projectile and an enemy. When a projectile hits enemy it have to disappear, but instead a game is crushing in the moment of contact. I don't know how to ...
0
votes
1
answer
72
views
My player model is clipping through objects in Ursina when using FirstPersonController module
I am experimenting with ursina and am trying to create a player entity with a working collider and model. I have run into a problem, no matter how hard I try, the collider just won't work. I am trying ...
0
votes
1
answer
66
views
Unity 3d weird stretching on collisions
When i collide with a game object (obstacle) with my player, it causes weird stretching and scale changes.
Here my obstacle collides with the side railing
here my obstacle collides with the player (...
0
votes
1
answer
100
views
How to improve circle collision logic for large clusters and prevent overlapping
I have a simulation that handles collisions of circles in a 2d space, using standard midpoint-axis overlap separation logic for the physics resolution. For collisions involving less than 3 circles, ...
0
votes
1
answer
129
views
Strange behaviour of GJK collision detection algorithm
In 1 image there is no collision, but in 2 there is
I have a bug with GJK algorithm. I am using glm library and I am facing a problem that when I increase the size of the model using matrix, GJK ...
1
vote
0
answers
43
views
Points system in Unity not working. I want to count points but make both objects disappear and it's not working
I'm developing a game, but I have hit a breakpoint and I can't figure a solution for my problem.
I want to make a bullet and an object, and when they collide, they both disappear and ads 1 point to a ...
0
votes
0
answers
210
views
How to make wall collision with staticbody2d & collisionshape2d ( using an area2D for player with collisionshape2d as a child ) in GODOT?
I wanted to know if I can make a player with area2d with a child collisionshape2d
and then make a collision with my walls having a node of staticbody2d
which has two childs in it of collisionbody2d
...
0
votes
0
answers
49
views
How do you get the numerical values in this collision function
so here is some code. basically, the goal here is for the turtle not to be able to pass any of the blue lines, meaning it can't go inside the shape. The code works perfectly but I don't particularly ...
0
votes
0
answers
32
views
Pygame slows down after Collision Handling PacMan [duplicate]
Hey i am trying to write a pacman game, PacMan runs very smooth, but if i add the collison
function which checks if theres a collision (it iterates over every block created in the map)
and then tells ...
0
votes
0
answers
50
views
Problem with a wall collision on a map loaded from a png file (like the raylib maze example)
I'm currently working on a uni project (I'm trying to make game sort of like Wolfenstein3D).
I used an raylib example of maze to make a map for my game.
But now i have problem with the wall collision ...
0
votes
0
answers
117
views
onCollisionEnter is not working in r3f how can i fix it?
I'm creating a map that moves the character with @react-three/fiber and @react-three/rapier.
I tried to create a collider on the door and when the player collides there, change isInside to true to ...
0
votes
1
answer
143
views
How to handle collision after a diagonal movement with rectangles
I'm trying to make a simple platformer but i have a problem with collision solving after a diagonal movement. I have a tile map with which i can iterate every tiles that are around of the player.
Here ...
0
votes
0
answers
40
views
Inverting a hitbox
I would like a hitbox for a sprite called "ring" to be inverted in code.org.
"ring" is a thin donut and I would like the hitbox to be inverted so then I can have a different sprite ...
1
vote
0
answers
38
views
Gamemaker collisions
i'm making a 1v1 tank game and i'm going crazy with collision
this is the code of the tank
if keyboard_check(vk_right){
obj_canon.image_angle -= 1.33
}
if keyboard_check(vk_left){
...
0
votes
0
answers
220
views
Python Pygame Platformer [duplicate]
I am just learning OOP with Pygame and have built a platformer where you move around with the arrow keys, up to jump, you can press R to add more blocks for an extra challenge and you can resize the ...
0
votes
1
answer
66
views
Java Ball Movement: Unexpected Behavior with Boundary Reflections
`Question:
I'm working on a Java program where I simulate the movement of a ball within a box. The ball is expected to reflect off the boundaries of the box using the vector reflection formula. ...
0
votes
1
answer
42
views
How to make a change on an object using OnCollisionEnter when there are multiple objects that are the same?
so I am practicing Unity's scripting and trying to build a prototype of Pachinko game.
What I want to achieve is when the ball hit an obstacle, it would change the color (material) - I have achieve ...
0
votes
0
answers
16
views
How do I make collisions?
I am making a python curses program and I need to know how to make collisions. It is an open world game.
`import curses
stdscr = curses.initscr()
curses.initscr()
curses.noecho()
curses.cbreak()
...
0
votes
0
answers
34
views
My PNG image is interferring with my collision code and I don't know how to fix it
for (int i = 0; i < asteroidCount; i++) {
asteroids[i].move();
if (asteroids[i].getY() <= 0 || asteroids[i].getY() + asteroids[i].getAsteroidHeight() >= getHeight()) {
...
-1
votes
1
answer
34
views
Collision not working with different sprites? [duplicate]
I followed a tutorial for a simple runner game using pygame and got it to work. So I went to try it again with my own characters and obstacles that I made. But for some reason, the sprites seem to ...