New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

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.

2,403 questions
Filter by
Sorted by
Tagged with
31 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 ...
• 184
25 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: ...
• 43
34 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 ...
47 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 ...
39 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 ...
47 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 ...
• 1
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 ...
• 43
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 "...
1 vote
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 ...
58 views

AABB Collision Resolution Per Face

I have this function that detect the collision of two AABBs: ...
• 124
1 vote
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 ...
55 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 ...
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 ...
26 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 ...
• 255
34 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, ...
• 736
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 ...
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 ...
53 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 <...
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, ...
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 ...
• 213
86 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: ...
1 vote
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 ...
• 111
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 ...
1 vote
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 ...
• 13
1 vote
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 ...
• 13.4k
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 ...
• 13
35 views

69 views

StaticBody2D on body enter without Area2D

How can I get the body_entered signal on a StaticBody2D without an Area2D? I know ...
1 vote
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 ...
• 1,763
68 views

...
• 1
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: ...
• 133
75 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 ...
• 5,253
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 ...
• 21
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 ...
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 ...
61 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 ...
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 ...
44 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 ...
95 views

Angry Birds style aiming (ballistic trajectory)

Could you please provide guidance on how to create the curved part? regard,
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 ...
• 2,628
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 ...
• 101
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 ...
• 550
1 vote
44 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 ...
47 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 ...
1 vote
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 ...