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,456 questions
1
vote
1
answer
120
views
Decelerating player's momentum without changing direction
I'm adding deceleration to my player character, decreasing their velocity over time when the player releases the direction keys.
With the code below, at non-perfect angles, the character seems to re-...
0
votes
0
answers
52
views
Active ragdoll in Godot 4.5: how to achieve good results?
I'm working on a 2.5D game in Godot 4.5 that uses skeletal animation + ragdoll physics.
I'm really happy with how the full ragdoll mode behaves, but I can't get anything close to a good active ragdoll ...
3
votes
4
answers
276
views
How are deltatime overshoots typically dealt with--or are they dealt with at all?
So I was implementing deltatime adjustment into a game when I thought of this problem. Consider a control case, with no adjustment for framerate:
Here, our character jumps up to a max height of 12.5 ...
0
votes
2
answers
119
views
When should an object with a collider have a rigidbody?
I had some questions about Physics / Rigidbody in Unity.
I have a 2D sprite with a collider. The 2D sprite is simply a card that I place on a table with the mouse. I use the collider for raycasting (...
0
votes
0
answers
49
views
How to detect which physics body of skeletal mesh has overlapped?
I have a skeletal mesh with a Physics Asset assigned to it as such:
This skeletal mesh is used within an ACharacter with collision settings as such:
And an actor which has the overlap event as such:
...
2
votes
0
answers
77
views
Changing prediction to interpolation on client connected to the authoritative server
Let's assume the following situation:
I have a server, that sends a snapshot of current game state to all the clients at a fixed time. Server is authoritative, all the physic calculations are done on ...
0
votes
0
answers
40
views
How do you setup a ramp with an existing tile-set in Unity?
(Beginner questions)
How do you setup the ramp with the tiles in unity?
The graphics and the behavior?
I've been checking this free tileset:
In the image it has connected ramps
I cannot seem to get ...
1
vote
0
answers
76
views
how to implement the vines in animal well
the vines in animal well display pixel perfect deformation when the pc moves through them. they also display rope physics but do not appear to be implemented by jointed segments of physics rigidbodies ...
3
votes
1
answer
117
views
Should physics substepping include the entire update or only collision resolution + constraint resolving?
I'm working on a simple physics simulation and I want to use substeps to improve stability. I’m unsure whether I should apply substeps to the entire physics update or just to collision resolution.
...
0
votes
1
answer
59
views
Best way to sync PhysicalObj to player headset position?
I’m in the process of designing a threejs-based webxr engine for simple VR games. Right now, I’m working on implementing physics with cannon-es, but I’m struggling to figure out how to sync the player’...
4
votes
1
answer
250
views
Train simulator - approach to cars movement
I'm prototyping a train simulator and running into design issues with physics and train car movement. The scope is similar to games like Run8, SimRail, or Derail Valley.
Requirements:
Realistic train ...
0
votes
1
answer
126
views
How to instantly stop when moving the character with AddForce?
I made character movement using AddForce. But I don't understand how to get the desired effect. I need that when I release a movement key (for example WASD) the ...
1
vote
0
answers
156
views
How to conserve momentum in Unity?
I tend to use a lot of 2D physics based (rigid-body based) character movement in Unity, and despite lots of tweaking, I can never seem to use conservation of momentum.
I’d have to manually program in ...
1
vote
1
answer
144
views
How to propagate linear/angular momentum to parts when a 2D tile-based ship is broken into pieces?
I have been working on a project in the Godot engine about creating tile based spaceships. It works great and I find it very interesting. My biggest issue though is correctly simulating disconnections,...
0
votes
1
answer
100
views
Lerping Time.timeScale causes laggy physics
I am using unity as my game development platform. I was trying to create script that could interpolate time scale to achieve a flurry rush.
The code below is my attempt:
...
1
vote
0
answers
87
views
How to properly handle ball movement in a soccer game?
I'm building a soccer game (or trying), and currently running into a problem when trying to achieve the desired pass/shot.
For projectile motion, it's fine, but trying to predict rolling movement is ...
0
votes
0
answers
120
views
Does anyone have the detailed breakdowns of physics in NES/SNES Mario games?
I'm working on basic clones of the classic Mario games I played on that Wii SNES emulator when I was younger to learn classic hardware emulation, platformer development, Monogame, etc. I found this ...
0
votes
0
answers
34
views
Toxiclibs softbody physics issue with jittering under weight
hopefully this is alright to post here. I'm learning to code and working on a thing (actually trying to reproduce this https://www.instagram.com/juhani.halkomaki/reel/DGFpqfCNgZe/ )
I have created a ...
0
votes
1
answer
96
views
How to get from torque to angular acceleration?
Wikipedia says:
In two dimensions, angular acceleration is a number with plus or minus sign indicating orientation, but not pointing in a direction. The sign is conventionally taken to be positive if ...
0
votes
0
answers
137
views
My car keeps flipping over (or drifting uncontrollably)
I am experimenting with 3D car physics in Unity and want a good car for a racing game.
I've been trying to implement turning (and drifting) for this car. I want the car to automatically drift at high ...
1
vote
1
answer
218
views
Collision detection and physics in a 2d pixel platformer
I'm reworking physics in a 2d action platformer I'm developing (no engine, c++ / sdl). Here's the general movement logic for all characters:
I calculate the offset I need to apply to the character
I ...
3
votes
0
answers
60
views
Collision response with external forces & small relative velocities
How do I deal with collisions that have small relative velocities, but external forces such as gravity?
Imagine a scenario with a box in 2D, rotated 30 degrees, and placed on the ground.
Gravity acts ...
0
votes
0
answers
49
views
Adding force to child, so that it affects the parent at the contact point
I'm a novice to game development and experimenting with trying to create an RCS thruster (child game object) on a capsule (parent game object).
What I am desiring to do is to apply a force on the ...
1
vote
1
answer
116
views
PGS solver leads to boxes spinning out of control or sliding out of stacks
I'm trying to implement a PGS solver for collision response, but I'm currently stuck.
How the problem manifests is, for the example of a box resting on the ground, if the box is given a small rotation ...
0
votes
0
answers
71
views
Making a slingshot inspired launch mechanism to hit arbitrary point on edge not just fling straight through center of mass
In a 3D world, I have a hockey puck-like body.
I have made a mechanic where I can launch the puck with a slingshot mechanism.
But the point of contact is determined with a raycast and the "sling ...
0
votes
2
answers
277
views
How do I synchronize thousands of game object transforms?
I'm trying to synchronize 3-4 thousand game objects' positions and rotations. I need performance for my Unity game to remain relatively high (30+fps) and to keep the amount of data sent as low as ...
0
votes
0
answers
74
views
How to Simulate Natural Falling Behavior for Stacked Shapes?
There is a thin, long rectangle placed slightly below a circle, and I let them fall simultaneously. When they hit the ground, they land perfectly aligned, one on top of the other.
In the real world, ...
0
votes
0
answers
85
views
The problem with the impulses in my physics engine
I have been analyzing the topic of creating a physics engine for a long time, at first I did it in a simple way, without thinking about real physics, then I began to do it on the basis of Verle ...
0
votes
0
answers
43
views
Custom Physics Engine::Impulse Based Contact Resolver::Facing Object crawling issue when doing Box vs Box Collision
I am trying to implement basic stable 3d physics engine, I was able to get collision phase working with SAT but when I am applying impulses on box vs box contact points, I face a crawling issue. ...
0
votes
0
answers
251
views
Softbody Vehicle Physics Like Beamng
I want to implement softbody vehicle damage like Beamng for my Burnout inspired game. The softbody physics dosen't need to be 100% accurate.
The problem is that I don't understand how to implementing ...
0
votes
1
answer
137
views
Character Controller isGrounded reports false when descending slopes
I encountered a problem in Unity related to the Character Controller, namely with checking whether the player is on the ground or not (isGrounded).
A player walking down a slope with a minimum angle ...
0
votes
0
answers
70
views
Chaos Flesh skeletal binding not working properly
I’m working on a medical VR simulation in Unreal Engine 5, using Chaos Flesh to create a soft-body-like structure for a human mesh. The mesh includes an esophagus, and I need skeletal binding to hold ...
0
votes
1
answer
147
views
Why am I getting stuck to a Platform (AnimatableBody3D) with Jolt3D?
I'm using Jolt 3D Physics for Godot, and my FPS character controller occasionally gets stuck to a platform moving with an AnimatableBody3D. Sometimes I get stuck to ...
0
votes
0
answers
109
views
Stickfight the Game Ragdoll Physics
I'm trying to make an active ragdoll in Unity 2D. The problem is that when you see mine as compared to Stickfight the Game or Off the Sticks, mine is very stiff and "janky". I just don't see ...
0
votes
1
answer
62
views
Cannot resolve symbol 'detectCollisions' on Rigidbody2D
I'm simply trying to disable collisions for a Rigidbody2D:
rb.isKinematic = true;
rb.detectCollisions = false;
as per: https://...
0
votes
0
answers
342
views
Teardown Voxel Physics
If we assume that Teardown was made in Unity, how would it be made in a high-level way?
See the game here. I tried some things like breaking each shape down into small voxels, but how do you determine ...
0
votes
0
answers
155
views
Momentum on a Kinematic Character Controller Does Not Work with Jolt 3D
After a long time, I’ve finally figured out how to add momentum to my Kinematic Character Controller in Godot 4.
Before: https://youtu.be/sPl-uA7OZ0Y
After: https://youtu.be/JvywZp5sQc8
In other words,...
1
vote
2
answers
278
views
How to make ball rotation in billiard look more natural?
I'm working on a billiard game in Unity (2D), where I used 3D sphere visually and I'm trying to make the ball's rotation look natural as it moves across the table or hit another. I've got the ball ...
1
vote
3
answers
1k
views
How to add a local gravity/force field in Godot?
I am trying to develop something in Godot and I was hoping it would be possible to create some sort of gravity field. I do not mean just the default falling down indefinitely. I mean like a kind of ...
0
votes
0
answers
71
views
Bullets frequently spawning below the floor
I have a bulletSpawnPoint, and it is correctly rotating and moving with player, but the bullets (I've replaced them with sphere without collisions) are spawning ...
0
votes
2
answers
159
views
How would I get an object's final resting position with linear drag and velocity?
I'm trying to make a system to see if a knockback would hit an object into an area in the scene. How would I calculate this in 2D?
I know there's \${v_f}^2 = v_i^2 + 2ad\$, but that only works with a ...
0
votes
0
answers
112
views
Need help controlling a 2d rocket to reach target positions at velocity vector constraints
The problem:
I have a rocket in a 2D space game that can apply force forwards and apply torque to turn. Now I want this rocket to reach a target point in the x,y coordinate system with a certain ...
0
votes
1
answer
72
views
How make a rigidbody not to change its trajectory by any external collsion?
I am trying to make a platformer game in which the player is able to run on the platforms. I have the platforms moving from the right to the left direction and the player is standing on top of the ...
0
votes
0
answers
90
views
Collision detection with CapsuleCast
I'm attempting to detect when a gameObject with a Capsule Collider and RigidBody attached it lands on the floor, which is a Mesh with a Mesh Collider attached it to it. Adding a tag to the Floor ...
2
votes
1
answer
93
views
Hard dropping blocks isn't instant and doesn't put it in the correct spot
Godot Version: v4.3.stable.official [77dcf97d8]
I'm trying to add the ability for blocks (frozen RigidBody2Ds) to be hard-dropped instantly (they get placed on the closest surface directly below them) ...
0
votes
2
answers
307
views
What does "Solid" mean in game development?
I was reading this article about physics in Celeste and Towerfall, and came across the use of the term "solid":
All of our physics are handled by two classes: Solids and Actors. Solids are, ...
1
vote
1
answer
183
views
Holographic principle applied to 3D rendering in video games
When reading about the usual methods of rendering 3D models in game programming one encounters ideas such as the Perspective Projection Matrix (rasterization), Ray tracing and Ray marching. On the ...
0
votes
1
answer
95
views
CharacterBody2D knockback not being applied in the correct direction
I'm having a problem with CharacterBody2D knockback in Godot 4.3 stable.
I'm creating a game where enemies (CharacterBody2D) can ...
0
votes
0
answers
98
views
Wheel collider for skateboard falls through the floor in Unity?
Problem: Why are the wheel colliders not colliding with the floor?
Here's a video that shows how the skateboard just falls through the ground:
https://imgur.com/a/Vx7QraF
I have this kind of hierachy:
...
0
votes
1
answer
242
views
Ball not bouncing infinitely with perfect elastic collision settings
I'm trying to create a ball that exhibits perfect elastic collisions, meaning it should bounce infinitely without losing energy.
Here's what I've done so far:
Set the ball's restitution to 1
Set ...