Questions tagged [physics]

Relating to the motion of objects through space and time. Including concepts such as acceleration (thrust and gravity), mass, collision response, friction and more.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

How to prevent jarring collision resolution when enabling a ragdoll?

After enabling a rigid body and collider on an object that is overlapping with another object, it applies a large amount of force to the object, so it jumps out of the overlap. The problem is worse ...
virtouso's user avatar
  • 2,588
0 votes
0 answers
21 views

Where is the friction coming from in this simple setup?

I'm creating a simple implementation of the classic cart and pole balancing control problem. I'd like to have a 2D interface with the cart and pendulum controlled by the Unity physics, so that I can ...
Steve's user avatar
  • 101
0 votes
0 answers
35 views

Should a free roaming camera movement be controlled by the physics engine (for smooth movement)?

I have a hobby engine (for fun and research) with a free roaming camera implementation that works by modifying the PositionComponent and ...
Mark Ingram's user avatar
1 vote
2 answers
30 views

Best way to implement a carrying tray in VR using Unity

I need a way to carry objects on top of other objects in VR without jitterness causing the objects to fall through a tray for example. I've tested with rigidbodies having very high friction, this does ...
Richard Muthwill's user avatar
0 votes
1 answer
35 views

3D Impulse based collision resolution not behaving correctly, what could be wrong?

I've implemented a collision resolution system based on Ian Mellington's System Cyclone and afterwards based on the Game Physics Cookbook. Currently the last one is implemented. For some reason the ...
Martin's user avatar
  • 1
1 vote
0 answers
32 views

Separating axis theorem implementation results in limitless extending colliders along the Z axis

I am trying to implement SAT and it works except for the fact that colliders extend infinitely along the Z axis and I can never get past them. I also have confirmed that ...
Jakob Tadej Vrtačnik's user avatar
0 votes
1 answer
26 views

Getting the scalar speed from an X and Y velocity [duplicate]

Given a Vector2(x,y) that represents an object's velocity, like so: ...
CAOakley's user avatar
  • 101
0 votes
0 answers
72 views

Seperating axis theorem is bugged

I am attempting to make split axis theorem for 2d collision physics. It does works, but is inaccurate. It is based off of: https://www.gamedev.net/tutorials/programming/math-and-physics/a-verlet-based-...
NoStepOnSnek's user avatar
0 votes
0 answers
33 views

How does bullet physics filter 4+ contacts in GJK?

If the bullet GJK (Convex vs convex) collision algorithm has more than four penetrating points, then how is it filtering that down to the four it needs? What I've tried Staring at the code, but I get ...
Baer Ran's user avatar
0 votes
1 answer
25 views

OnCollisionStay outputs strange contactpoints

I am currently trying to make a pen draw on a paint. I am searching for contact points on the paint but there is too much contact points than expected. I'm not sure to properly understand how ...
Hazard4U's user avatar
0 votes
0 answers
50 views

Determining meters per second in scaled terrain

I have a terrain with a width of 199 and height of 99 and I'm scaling this train by 500. What would be 1 meter in the new terrain, would it be 500? I'm trying to move my character in meters per second ...
blov's user avatar
  • 1
0 votes
2 answers
65 views

Bouncing balls miss collisions, bounce the wrong direction, of lose momentum on one axis when hitting a corner

I am making a 2D game where balls bounce from the edges of the screen, However, there seem to be two types of issues with this kind of bounce method, and every tutorial I checked uses the same method. ...
ZozeR's user avatar
  • 42
4 votes
2 answers
135 views

Order of updates in falling sand simulation

Looking into the classic "falling sand" simulation I've run into a question that I couldn't find addressed anywhere. Most people appear to agree that the update has to go bottom-up, because ...
Seg Fault's user avatar
  • 141
0 votes
0 answers
45 views

Brick Breaker - Adjust ball's collision angle without affecting speed

I'm working on a Java Brick Breaker game, and it's functional so far. However, I'm facing an issue with collisions. Currently, when the ball collides it simply reverses its direction. I want to ...
Zappiermike's user avatar
1 vote
0 answers
61 views

In Unity 2022+, Unity.Physics 1.0.16, what is the proper way of detecting collisions with a job?

I have properly defined the CollisionEventJob, scheduled it, and attached necessary components to my entities, but for the love of God, ECS is not detecting collisions between those entities. Here is ...
rasputin's user avatar
0 votes
2 answers
86 views

Detecting collisions with trajectories

What if an object were to have collision detection implemented as so: A ray in the direction the object is moving in, and a ray in the direction of gravity.
Nato's user avatar
  • 9
0 votes
0 answers
33 views

unity wrong ragdoll behavior on slowmotion

I use simple logic to make a slow-motion effect. It works fine but it makes ragdoll animations feel like they have no weight and move easily. This is the sample code: ...
virtouso's user avatar
  • 2,588
0 votes
1 answer
96 views

How to code glider movement in 2D? (Godot 4)

So in Minecraft, you have the elytra. When you look up, the character moves up. When you look down, the character moves down. The speed you move forward depends on the angle you are moving. I want to ...
Shattered Reality's user avatar
3 votes
1 answer
141 views

Character overlaps with static objects

I am creating a simple OpenGL C++ game. I have a main character (green box) and some static objects (red boxes) positioned as stairs. The problem is as green box is descending down the stairs, it ...
Axel's user avatar
  • 33
0 votes
1 answer
80 views

Sphere to plane collision

I could check for the distance of a vector from the sphere's center to the plane's center, but that would be inefficient, since there are multiple positions where they may not be intersecting but ...
Nato's user avatar
  • 9
0 votes
0 answers
43 views

Box2d's SetLinearVelocity not working as expected

I'm working in a SFML and Box2d project, and I stumbled with a problem related to the linear velocity of bodies. I've created a simplified version of the project, and the problem still persists, this ...
BOOM's user avatar
  • 11
1 vote
1 answer
71 views

Adaptation of values from previous constant frame rate to new constant frame rate

I'm trying to learn how to adapt my old values to new values. First of all, I don't use delta time at all. My game has lock with 30 FPS and I want to lock it with 60 FPS, I wrote all my values in ...
dt_'s user avatar
  • 11
0 votes
0 answers
56 views

How is terrain collision handled

GJK can be used for all shapes but what if the points in a figure aren't indexed, then how can we get the Minkowski space by adding the correct pairs of points even though we don't know them, and also ...
Nato's user avatar
  • 9
0 votes
0 answers
85 views

Why doesn't multi-constraint work in this case?

The situation is as follows: There are two objects and there are 3 constraints between the two objects. $$ \dot{C}=(\vec{V}_{rel_a} - \vec{V}_{rel_b}) \cdot normalize(\vec{p_{a}} - \vec{p_{b}}) $$ &...
noodle_run's user avatar
0 votes
0 answers
37 views

How to implement 2D rigid body motion?

I'm already depending on two NPM packages for 2D collision and differential equations: sat rungeKutta I've a basic simulation structure, but don't know where to start with to use these two packages ...
Hydroper's user avatar
  • 101
0 votes
0 answers
41 views

How do you do vehicle rendezvous?

If you want to have a missile track and hit a target, Proportional Navigation is a common technique. But that's simple intercept and collision, getting the pursuer to the same X, Y, Z as the target. ...
Will Hartung's user avatar
0 votes
0 answers
48 views

How to rotate body in server-side physics without imparting angular velocity?

I'm developing a 2D cloud-based MMO using WebSocket and have struggled a lot to get proper working physics on the server side. I'm using Next.js for the client and currently Node.js for the server. I ...
Hydroper's user avatar
  • 101
0 votes
0 answers
51 views

FixedUpdate in Unity

I am trying to test my project for different discretization levels of a game object. For this I use a metric to compare the dynamics of the object for different discretization (compare the positions). ...
the2second's user avatar
1 vote
1 answer
122 views

Raycast suspension simulation rebounds car on landing

I'm expecting the car to land and engage the suspension to dampen the landing. The code I'm using currently has this effect: ...
Lousifr Illuminos's user avatar
1 vote
1 answer
76 views

Units in Unity?

I have read that in Unity 1 cube of size 1x1x1 and scale 1x1x1 is representing a cube in real life of 1mx1mx1m. Now, the only setting I find, where I can input anything related to Units is gravity, ...
the2second's user avatar
0 votes
1 answer
40 views

Time aware point -> capsule swept collision detection?

the simplicity of Minkowski sums are one of the big reasons capsules are used in collision detection, especially for player models. One of the benefits of this should be the ability to perform ...
Krupip's user avatar
  • 1,713
0 votes
0 answers
17 views

How can I halt a check for intersections of sets in python when it discovers one member of the intersection?

How can I halt a check for intersections of sets in python when it discovers one member of the intersection? I want to do this so that when checking for collisions the moment an intersecting point is ...
Nato's user avatar
  • 9
1 vote
0 answers
109 views

Realistic bouncing ball physics

I am trying to implement realistic physics for my game plinko. As of now i only implemented the inversion of the velocity and the distance between both objects. ...
Jonasoos's user avatar
0 votes
0 answers
34 views

How can i translate this code into java?

My only problem translating the code from this question/answer is the Vector2 method. In the web i could only find this replacement (Vector2f). But i can not import it : can't resolve reference. Also ...
Jonasoos's user avatar
1 vote
1 answer
43 views

KinematicBody2D stutters/moves back and forth

I'm working in Godot 3.5, and trying to set up a navigation polygon for my kinematic body to mode around inside, but when I try to send it to some point, the body 'stutters'/moves back and forth in ...
Progs's user avatar
  • 93
0 votes
1 answer
59 views

How to calculate angular momentum of two colliding bodies about their shared center of mass in 2D?

I'm following this guide to implementing collisions in 2D physics. It shows this diagram, but I don't understand how to calculate the values of Da and ...
noodle_run's user avatar
0 votes
0 answers
46 views

Why are global constraints so ineffective?

There are two objects here, each with 3 constraint points. I use formula: $$ \lambda=(JM^{-1}J^{T})^{-1}(-JV-b) $$ $$ \Delta V=M^{-1}J^{T}\lambda \ $$ I put the information of the three constraint ...
noodle_run's user avatar
0 votes
1 answer
55 views

How to Constantly Apply a Force to a Rigidbody Within a Coroutine?

For my game, I am trying to write an enemy behavior script, where the enemy walks forward for 1 second, then stands still for 1 second, then walks forward, stands still, etc. To implement this, I have ...
NateBob's user avatar
0 votes
1 answer
104 views

Car gets stuck to the ground when trying to go upwards

When I tried to go on top of the container, my car got stuck. Here is a picture of the situation: I am using 4200 for mass and defaults for drag and angular drag. ...
Mobin Bagheri's user avatar
1 vote
0 answers
91 views

I don't want my plane to go trough walls, I want it to stop on obstacles

I'm currently working on my first Unity Learn code challenge, making a Flappy Bird style game where a plane needs to fly through gaps between wall obstacles. I've successfully implemented all the ...
Mila Data's user avatar
0 votes
0 answers
68 views

Can Box2D be configured to conserve total energy of the system?

What I want I want a physics engine that can support a few dozen balls and polygon objects interacting with each other in a closed environment. It needs to support objects rotating after collision. It ...
redmoncoreyl's user avatar
1 vote
0 answers
41 views

Trying to plot trajectory of rocket using only its current position and velocity components

I have a 2D controllable rocket for which I want to plot the parabolic motion. Additionally, the parabola should be able to change due to the thrust of the rocket accelerating it in either direction. ...
confused_aspirant's user avatar
0 votes
0 answers
44 views

Physics2D.OverlapBoxAll misses small overlap

I have a tetris-like 2D game with tiles, each made up of a sprite, a Rigidbody2D and a BoxCollider2D. The tiles fall from the ...
ChrisC's user avatar
  • 116
0 votes
1 answer
92 views

Physics.OverlapBox not detecting 2D collider objects

I have a 2D game with several square objects (tiles) that each have a BoxCollider2D and a kinematic Rigidbody2D. I want to detect when one tile is located to the right of another tile, such as to ...
ChrisC's user avatar
  • 116
1 vote
1 answer
363 views

How to disable a layer in a Tilemap's collision mask via code?

I have a tilemap in Godot 4.1 and I have defined a physics layer for a tileset, but I cannot figure out how to disable a layer in collision mask in code. I already found out that I should get tileset ...
Adonia Kazemzadeh's user avatar
0 votes
1 answer
40 views

How can I prevent my ball from slowing down when it makes contact with the corners of colliders

I'm trying to make a game where the player has to destroy blocks. But when the player collides with the corners of the blocks, the player's velocity slows down, or even stops. How can I ignore the ...
Smizzles's user avatar
0 votes
0 answers
37 views

My game's physics are behaving non-deterministically and I'm not sure where to start to solve the issue

I'm trying to get my game to behave deterministically just on my system. I can get it to behave deterministically if the scene is freshly loaded, but if I attempt to just reset the scene to its "...
iamconfusion's user avatar
3 votes
1 answer
2k views

Why objects are falling equally in Unity

I have different game objects with rigid bodies, each having its own mass and drag. However, when these objects fall, they appear to fall at equal speeds. This raises the question of why they do not ...
Muhammad Faizan Khan's user avatar
0 votes
0 answers
38 views

Problem with physics object tunneling using Nez and monogame

I was using the Nez engine with monogame to create a platformer, I made the player character an ArcadeRigidBody and the map collision shapes were handled by a TiledMapRenderer, but I noticed that when ...
gradien's user avatar
-1 votes
1 answer
72 views

where should i start if i want to make an enemy from robots forever 2 (or if you are unfamiliar a physics based enemy that uses procedural generation)

this is probably a long shot, but I didn't really know where to ask this question. I just wanted to ask if anyone knows any resources that can help explain how to make something like this. Thanks, and ...
Milo Does Gaming's user avatar

1
2 3 4 5
48