Skip to main content

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.

438 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
8 votes
4 answers
10k views

Handling movement on sloped surfaces - clamping character to sloped surface

I've noticed that a lot of people seem to have this issue but I've yet to find an actual working solution - when a rigidbody-based character controller (I'm not using Unity's character controller) ...
katsuragi545's user avatar
6 votes
4 answers
2k views

Lunar Lander calculating gravity, acceleration and collision in GameMaker

I've already asked this on the GameMaker forums but had no response so far. I'm making a little Lunar Lander game as my first foray in to GameMaker, I'm wanting to have the ship land and take off ...
el_simmo's user avatar
6 votes
0 answers
186 views

How can I create a set of collision points for an arbitrary mesh?

In my project I am working on automatically deforming an arbitrary mesh with respect to another arbitrary mesh, within the context of user generated content, similar to this deformer being developed ...
sebf's user avatar
  • 2,664
5 votes
0 answers
551 views

3D Physics Engine Collision Response: Solving Simultaneous Collisions via equation

I have been implementing a basic physics engine for a small game project I'm working on. It has very specific requirements, so I decided to try and write my own physics engine to meet them. I found ...
GiantCowFilms's user avatar
5 votes
0 answers
297 views

Rotation of a ball moving on a surface

I have a ball that moves along a platform. The ball is characterized as a sphere that has a radius and a position. The platform basically is a rectangle consisting of two vertex triangles. Its class ...
vigilanum's user avatar
5 votes
0 answers
227 views

Sizing a Box2D ground object

I am developing a platformer game using SDL2 for graphics and Box2D for physics. I am currently designing my levels and would like to know if it is better to make the static part of each level (ie: ...
user66319's user avatar
5 votes
1 answer
166 views

How can I determine "exact moment" of collision with ray casting?

I'm currently brainstorming how the physics for my game engine is going to be handled. It's top down and I'm thinking of using ray casting for collision detection. I've reached two potential problems (...
Ghork's user avatar
  • 191
4 votes
0 answers
103 views

Force propagation through physic bodies constraints (as non-penetration)

First, some context I'm currently implementing a (well, tiny) game engine using a predictive approach. The idea is to compute when a state change will occur, and only update state at time of the ...
Felix Bertoni's user avatar
4 votes
1 answer
1k views

Friction due to gravity in an impulse based physics engine

In my physics engine, I'm using impulses to solve collisions. I'm basing all calculations on these equations: ...
dreta's user avatar
  • 3,524
4 votes
1 answer
2k views

Disc Golf Physics in Unity

I am trying to make a frisbee golf game, and I am stuck on the physics of the frisbee. I can get the disc to fly, but I have not been able to add spin or make it act the way a frisbee would in real ...
linuxer's user avatar
  • 141
3 votes
0 answers
160 views

How do you compute for angular spring physics for physics joints in game engines?

I'm working on fixing Godot's physics joints. Currently, it uses Euler angles and it doesn't help me in building active ragdolls for my game. I heard that using quaternions is the way to go. So I ...
PHO BOSS's user avatar
3 votes
0 answers
157 views

Faster convergence in a physics engine

I've got my hands on the first edition of the book Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for your Game by Ian Millington. Because I didn't really know ...
Peter Lenkefi's user avatar
3 votes
2 answers
334 views

With gravity enabled, how do you move a RigidBody forwards at a specific speed?

I have a perfectly smooth cube on top of a perfectly smooth plane. I am applying a forward-force of 1 unit per second, using ...
flatterino's user avatar
3 votes
0 answers
193 views

How to implement path-finding with a large number of blocking agents following similar paths?

I want to implement a demo like creeps laning in Dota 2. So for simplicity, there is Left team and Right team, they are enemies. Units from Left team move toward Right base, and units from Right team ...
KeNVin Favo's user avatar
3 votes
0 answers
315 views

How to properly write "stick to surface" character logic that handles unexpected large time deltas?

I've been trying to wrap my head around this issue: in a 2D platformer game (but this may as well apply to 3D games) I want the character to "stick" to the surface that it's moving along and at the ...
mt_'s user avatar
  • 576
3 votes
0 answers
370 views

Bullet Physics Scaling rotational part of 6DoF Spring Damper

I am currently trying to scale up my setup (consisting of two rigid bodies connected by a btGeneric6DofSpring2Constraint) to fall within the suggested dimensions for a concise simulation. In order to ...
Flo Ryan's user avatar
  • 131
3 votes
0 answers
592 views

Add Rigidbody and MeshCollider at runtime : is it a bad practice?

Good day. To simulate an explosion of a vheicle, I decided to do this: When I need to explode veichle , at runtime, i add rigidibody for every single part of veichle (5-10 part: door, wheel, hood ...
stighy's user avatar
  • 437
3 votes
0 answers
323 views

UNET Performance of (many) Kinematic Rigidbodies

I am building a game in Unity in C# using the UNET networking elements. I am trying to figure out what is the performance cost of kinematic rigidbodies? My understanding is that, when kinematic, ...
ZCaceres's user avatar
3 votes
0 answers
75 views

Solving constraints/joints in 1D

For n points moving in 1 dimension. Position and velocity are known for each point. Each frame a basic integration is done for each point: ...
Souk21's user avatar
  • 31
3 votes
0 answers
165 views

How to aim with a spaceship in 3D considering its angular momentum?

So I have a spaceship and I have 6 degrees of freedom. At a given moment the following vectors are known of the spaceship: Local forward. Local up. Local sideways (may be implied from the previous ...
Calmarius's user avatar
  • 661
3 votes
1 answer
2k views

How to code a non-newtonian spaceship control script?

I'm working on a simple 3D space combat game, and I've decided to go with simplified physics over proper newtonian motion, similar to the space sim Oolite, and more 'arcade' style games. I basically ...
moran's user avatar
  • 147
2 votes
1 answer
638 views

How to implement grapple hook and swing

I'm trying to make a retro style grapple hook / swing system that has a constant speed and is not based on real-life physics. Like the one in Axiom Verge, Bionic Commando (NES) and Super Metroid.
user2272675's user avatar
2 votes
0 answers
75 views

Calculating spring constant c

Suppose we have 2 springs with different values for m and k. The first spring is given an arbitrary dampening value, ...
19172281's user avatar
  • 151
2 votes
0 answers
59 views

How to connect particles to rigid bodies in LiquidFun?

In vanilla Box2D various types of Joints can be used to connect two rigid bodies together. The LiquidFun extension brings the Particle Module, but I was unable to find a way to connect a particle/...
Simon Zvara's user avatar
2 votes
0 answers
424 views

How to accelerate car based off of Animation Curve?

I am making a karting game and I want the karts velocity to accelerate based off a curve. This would allow me to quickly iterate different types of cars that accelerate in different ways. I was ...
Jacob Edie's user avatar
2 votes
1 answer
81 views

How do I get the consistent time it would take for two points to reach each other in circular motion?

I'm making a 2D game. It involves the player swinging around a grapple hook in perfect circular motion, however, I want to make the cooldown for this ability based on predicted end position for the ...
Andrew M's user avatar
2 votes
0 answers
84 views

How can I make my table move more realistically after a collision?

Using Unity 2020. I have a character using CharacterController and Rigidbody, colliding into the end of a long table. My table has, as a root object, the mesh and the Rigidbody. It also has, as child ...
alexx0186's user avatar
  • 121
2 votes
2 answers
413 views

Interpolation on Rigidbody2D not working

I'm trying to achieve smooth movement for a ball. I seem to be failing to achieve this and now I've created a sample scene, which shows my setup from the game and the problem exists in that sample ...
iQew's user avatar
  • 470
2 votes
0 answers
764 views

How to achieve variable jump height in an elegant and natural way

I am making a platformer, with a methodical approach to player physics. This is how I do variable jump height: ...
eguneys's user avatar
  • 247
2 votes
0 answers
101 views

Handling strange physics behaviour while sliding between coplanar surfaces

We've got a character setup based around manually resolving collisions, and we're using bullet to do so. Our characters have a kinematic rigidbody to push things around, but their movement and ...
Mick Derks's user avatar
2 votes
0 answers
840 views

Realistic 2D air friction in unity

I want to make an evolution games similar to this old games that was generating cars. Except I want it to be more realistic. So I want air friction to impact the speed of my cars, but how do I do ...
sliders_alpha's user avatar
2 votes
1 answer
815 views

calculating the trajectory of an object in SpriteKit when an impulse is applied to it

I want to make a trajectory line of little balls of where the object is going to go after an impulse, sort of like what is in Angry Birds. I did some research and it seems that the physics in ...
JoeBob123's user avatar
2 votes
0 answers
574 views

Simulating Water by changing Y values of Quad Vertices

hopefully this isn't too difficult to answer, but I'm stuck and could at least use some input. I'm working on simulating water for the first time with basic wave functionality. As in I click at a ...
David King's user avatar
2 votes
0 answers
564 views

2D platformer:How to avoid "bouncing descend" when walking down slopes?

I've been working on implementing slope collision by SAT(Separating Axis Theorem). And then I have a trouble. When my character walks down slope, it moves like a bouncing ball: The slope has 3 ...
undefined000's user avatar
2 votes
0 answers
109 views

Soft-restart tampers with physics determinism, resulting in different results

Updated question I have a Spawner entity that spawns my Rollables: ...
tomsseisums's user avatar
  • 3,366
2 votes
0 answers
603 views

Unity applying forces using animation

I'm trying to make a croquet mallet swing to hit the ball using an animation that rotates the mallet mesh. The mesh appears correctly positioned to hit the ball in the center but the ball doesn't go ...
Reed G. Law's user avatar
2 votes
0 answers
625 views

Calculate Orbit Path/Ellipse given mass, velocity, and distance (2body)

Calculate and draw the path of an orbit in a 2 body problem given the mass, current velocity, and distance of both bodies? We're working in Unity and will be using the default rigidbody.mass to start ...
Thundax's user avatar
  • 31
2 votes
0 answers
1k views

2D Distance Field as collision handler method

Pixeljunk Shooter has really cool fluid simulation. I found the dev's video explaining what they did. Here I understand that it is particle based simulation Smoothed Particle Hydrodynamic I can ...
Tofu_Craving_Redish_BlueDragon's user avatar
2 votes
0 answers
267 views

Storing rigid body collision shapes in local or world coordinates

I'm writing the beginnings of a lightweight 2d rigid body engine (in javascript, as a hobby project), and i'm debating whether to store collision shapes in local or in (updated as needed) world ...
skwashi's user avatar
  • 36
2 votes
0 answers
288 views

How do I compute the angle between a pixel on an irregular curve and a circle colliding with it?

I'm building a custom physics engine to accompany a level-editor. This image shows how the level-editor outputs levels: Now, some explanation is in order. The curve is defined by the red points. ...
MemoNick's user avatar
  • 121
2 votes
0 answers
183 views

Newton Game Dynamics: Making an object not affect another object

I'm going to be using Newton in my networked action game with Mogre. There will be two "types" of physics object: global and local. Global objects will be kept in sync for everybody; these include ...
jmegaffin's user avatar
  • 4,923
2 votes
1 answer
1k views

finding the angle to launch a projectile at a 3d coordinates

I have a game where the user can shoot a bullet and the bullet flies through 3 dimensional space and eventually hits the ground somewhere. My question is how can I calculate the ...
ZeroByter's user avatar
  • 121
1 vote
1 answer
47 views

How can I constrain a RigidBody ball to move along a path, but only apply forces to keep the ball on the path without adding velocity?

I'm currently working on a game and I'm hung up on this particular issue. I have a ball that is a RigidBody. The RigidBody is ...
Lewis Cianci's user avatar
1 vote
0 answers
16 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
1 vote
1 answer
54 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
1 vote
0 answers
112 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
1 vote
0 answers
34 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
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 vote
0 answers
145 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
1 vote
1 answer
193 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
2 3 4 5
9