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.
442
questions with no upvoted or accepted answers
8
votes
4
answers
11k
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) ...
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 ...
6
votes
0
answers
191
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 ...
5
votes
0
answers
573
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 ...
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 ...
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: ...
5
votes
1
answer
167
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 (...
4
votes
0
answers
109
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 ...
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:
...
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 ...
3
votes
0
answers
163
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 ...
3
votes
0
answers
159
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 ...
3
votes
2
answers
336
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 ...
3
votes
0
answers
197
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 ...
3
votes
0
answers
320
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 ...
3
votes
0
answers
372
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 ...
3
votes
0
answers
599
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 ...
3
votes
0
answers
324
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, ...
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:
...
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 ...
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 ...
2
votes
1
answer
709
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.
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, ...
2
votes
0
answers
63
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/...
2
votes
0
answers
429
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 ...
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 ...
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 ...
2
votes
2
answers
418
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 ...
2
votes
0
answers
777
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:
...
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 ...