Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
16 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
1 vote
0 answers
14 views

Applying impulses simultaneously at each contact point or sequentially?

I'm coding a 2d physics engine in python, and I'm struggling to understand the right way to implement collision resolution when there are multiple contact points. Consider a very simple collision case ...
snickerdoodles777's user avatar
0 votes
2 answers
49 views

How can I implement actor velocity / acceleration with fluid changes if direction changes are small, and abrupt if the direction changes are large?

I hope the question title makes sense. I haven't been able to google for an answer because I don't know what the correct terminology I'm looking for is. Basically, I have an actor / enemy / game ...
NeomerArcana's user avatar
0 votes
0 answers
26 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
1 answer
35 views

Is it possible to design character movement system with Bezier Curves?

For context, I'm trying to create a really dynamic and fast character. That can suddenly move slow, fast, zap into places, dash, and hover in place. Say that I want to make a character accelerate a ...
curiousCprogrammer1231's user avatar
0 votes
1 answer
49 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
42 views

Discretised Physics in Voxel Space

In most physics-based voxel games (like Teardown), there is usually an object-space voxel grid for each object, but no corresponding world-space grid. This means that a voxelized object can be ...
marked-off-topic's user avatar
0 votes
0 answers
48 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
16 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
0 votes
0 answers
27 views

Friction effect occasionally not applied

I'm developing a racket-ball behavior, the expected behavior is similar to a realistic tennis racket and ball, meaning both velocity and ang. velocity should be precisely applied when the ball "...
Omer Simchoni's user avatar
1 vote
1 answer
51 views

How can I simulate locking or limited-slip differentials in Unity?

I have been developing a racing game in Unity for a few months and I can't find any information on how to simulate a car differential. Right now I just split the torque generated by the engine 50-50 ...
Jorge Cambero Mogena's user avatar
0 votes
0 answers
58 views

AABB Collision Resolution Per Face

I have this function that detect the collision of two AABBs: ...
Scollier's user avatar
  • 124
1 vote
2 answers
67 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
56 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
3 votes
1 answer
80 views

Automated playtesting in a 2D platformer

For a hard 2D platformer I'm working on, I want to make an automated playtesting system. The goal is to allow every level to be tested in parallel as part of an automated test suite. These tests would ...
crass_sandwich's user avatar
0 votes
0 answers
27 views

How to implement flexible, deformable shapes?

I'm making a top-down, 2D wargame that simulates large numbers of troops fighting. Instead of taking the Total war approach and modelling each soldier individually, I represent them as 1000-man ...
DeeCeptor's user avatar
  • 255
0 votes
0 answers
37 views

Suspension vector direction of a raycast vehicle

I'm working on a raycast-based vehicle in a 3D world using a physics engine. It's basically a chassis object that contains a transform (translation, rotation, scale), a dynamic rigid body (with mass, ...
Splo's user avatar
  • 736
2 votes
1 answer
75 views

Pin object to the end of a rope

I'm trying to make a cool simulation where a rope swings with an object attached to its end. I've set up the rope using Verlet integration and used Hooke's law to attach the object. But here's the ...
Ainsley Harriott's user avatar
0 votes
0 answers
34 views

How to move a Rigidbody forward using Bullet Physics

I'm currently developing a character controller for my game framework, and I'm utilizing the Bullet Physics engine for the physics simulation. In the process of adjusting the velocity, I aim to enable ...
Wagner Andreas's user avatar
0 votes
0 answers
54 views

How to calculate velocity based on force at an angle

I have a 2D top-down jetboat that is moving (has a x, y velocity). I apply the velocity by multiplying against the delta time <...
fresh's user avatar
  • 1
0 votes
1 answer
42 views

Game Physics Engine : Euler integration : why body under gravity is not covering 9.8 meters/second?

I am working on very basic physics engine and I used euler interation which works like below, ...
videogamechef's user avatar
11 votes
3 answers
3k views

How hard to brake to perfectly smoothly reach the destination?

Goal I want the get the required minimum deceleration to perfectly smoothly reach a target. (The car's AI should know how hard it has to brake to be the perfect valet.) Research "How can I ...
st_phan's user avatar
  • 213
0 votes
3 answers
90 views

Implementing framerate independent friction with linear deceleration

I'm implementing friction into my game, and I'd like it to be framerate-independent. Here's my first solution, in Lua style pseudo-code: ...
Yolwoocle's user avatar
1 vote
1 answer
46 views

Momentum of a ball on a moving platform

I'm seeking information on how to implement something. I have a ball on a moving platform. The ball has a position and momentum. Here's a gif illustrating the situation: So the way it works is, the ...
KiraHoneybee's user avatar
0 votes
0 answers
51 views

Physics Engine Collision Response

I'm making a game engine with my integrated physics engine and I've encountered a problem where rigidbodies tend to over react in collisions and move around without and intention to slow down, I have ...
Gelis 07's user avatar
1 vote
1 answer
72 views

When should I call the physics simulation within the game loop?

I am thinking about where to call the physics simulation. The current situation is that I first update the entities and then the physics immediately before rendering. As you can see in the following ...
Andy's user avatar
  • 13
1 vote
1 answer
45 views

Why is my spring exploding? And how to fix it?

Let's say I have a 1-dimensional spring, and I want to simulate it by applying a force that may vary with time. We can skip friction and dampeners for now. From what I learned many years ago in high ...
Panda Pajama's user avatar
  • 13.4k
0 votes
2 answers
110 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
0 votes
0 answers
35 views

Why do we need two constraints to calculate the friction impulse?

Why do we need two constraints to calculate friction force? $$ \begin{align} K_{fric_1} &= J_{fric_1}M^{-1}J^T_{fric_1} \\ &=(-u^T_1 -(r_1 \times u_1)^T u^T_1 )(r_2 \times u_1)^T) \\ K_{...
noodle_run's user avatar
1 vote
0 answers
99 views

How to implement soft-body blobs that don't pass through one another

I am learning about soft-body implementations in Unity recently, and I stumbled upon the game Blob Merge 3D. It is quite an interesting implementation because the blobs do not overlap one another and ...
creekat's user avatar
  • 11
0 votes
2 answers
107 views

Calculating velocity to reach the jump height while the player presses the jump button

The height of the jump depends on how long the player presses the jump button. There are only two parameters - height and time. Gravity is constant. Let's say that the height has three units, and the ...
Demexis's user avatar
0 votes
0 answers
15 views

"Sticking" occurs in collision constraint solution

Two rectangles collide, use the following formula to calculate: $$ J = \begin{vmatrix} J_{1} \\ J_{2} \\ J_{3} \\ \end{vmatrix} $$ $$ J_{n} = \begin{vmatrix} \overrightarrow{n} & \overrightarrow{...
noodle_run's user avatar
0 votes
0 answers
69 views

StaticBody2D on body enter without Area2D

How can I get the body_entered signal on a StaticBody2D without an Area2D? I know ...
Salem Domani's user avatar
1 vote
0 answers
33 views

Physics interpolation given an asynchronous physics thread

I've followed https://gafferongames.com/post/fix_your_timestep/ to do interpolated physics. I have a separate thread entirely from my graphics thread. I use vulkan which allows me to do asynchronous ...
Krupip's user avatar
  • 1,763
0 votes
0 answers
68 views

Reversing the velocity doesn't work after being built

...
Leo's user avatar
  • 1
2 votes
2 answers
152 views

How to make the player pass through only certain objects, but not others?

Experimenting with my 1st Unity project. It's about a top down swimmer. By toggling the swimmer's collider, he can swim under boats: ...
Tomo's user avatar
  • 133
0 votes
0 answers
80 views

What is best to achieve bullet ballistics: frame by frame raycasts, or CCD?

I plan to achieve bullet ballistics at long distances, with a slight drop. I would also try to add networking reconciliation with a library, since I don't really have the skills or resources to ...
jokoon's user avatar
  • 5,253
0 votes
1 answer
27 views

Can't move rigidbody2d when using animations

I have a player moving and jumping by changing its x or y velocity. It worked well until i created a walking and idle animation. Now, the player is animated correctly when idle or walking, but does ...
Usylom's user avatar
  • 21
0 votes
1 answer
41 views

How to check for collisions between objects with the same script?

I am creating a game where there would be two objects instantiated. Each one has a script (to check for collisions), a Rigidbody2D component and a ...
Saharsh's user avatar
0 votes
2 answers
71 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
0 votes
0 answers
62 views

How to "float" a capsule with a rigidbody component in unity?

I've been stuck in a rut trying to figure this out for a while now. What I want is to have a capsule hover above the ground at a set height to eliminate ground friction and make irregular surfaces ...
Sundayz's user avatar
0 votes
0 answers
32 views

Getting 3D slide direction

I am trying to make my player slide down a curve (like a water slide) and so far I’ve managed to get the slide direction using the following code ...
Andrei Cristian's user avatar
0 votes
1 answer
45 views

Simulating the behaviour of small objects coming to rest on the surface of an asteroid, 2D

I have a large asteroid object, and I want to use physics2D to have smaller objects be attracted to it as if by gravity, and come to rest on its surface. The asteroid itself is also a dynamic ...
arcadeperfect's user avatar
-1 votes
1 answer
95 views

Angry Birds style aiming (ballistic trajectory)

Could you please provide guidance on how to create the curved part? regard,
Saeed Asmani's user avatar
0 votes
0 answers
51 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,628
0 votes
0 answers
22 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
45 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
45 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
48 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
55 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

1
2 3 4 5
49