People who code: we want your input. Take the 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.

353 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
37 views

### Large values for Rigidbody Velocity (UNITY3D)

I'm making a simple FPS game. I've come across this problem that I am unable to solve for quite some time. If this is question has already been asked before then do let me know. The problem at hand is ...
46 views

### Proper sphere collision resolution?

I am implementing a sphere to sphere collision resolution and I am a little confused on where to start. First question, is there a standard way that games/engines do sphere to sphere collision ...
26 views

### Getting “continuous collision detection”-like behaviour out of triggers

I have a particular scenario where I want to use a trigger to adjust the course of a fast-moving projectile, but am running into issues because Unity does not support continuous collision detection ...
146 views

### How to make Rigidbody.AddForce less delayed in Unity3D?

I'm trying to make it so that when the player in my game moves left or right, he lightly jumps from his current position to his new position. The way I have it set up now, the jump occurs once he has ...
151 views

### Simple collision resolution in a platformer game

I want to make a 2d platformer with moving, jumping and wall sliding. How can I make a simple pleasant collision resolution system that works for the following rectangles. Player is red, platform is ...
99 views

### How to calculate tangents in beam data to fit given trajectory

I'm currently trying to create a trajectory effect (in UE 4.25.1) similar to one from the last of us: I have created a beam with niagara, which lets me determine the starting point of the beam, ...
137 views

### How to use continious collision detection in a dynamic AABB tree

I am currently writing a game in c++ using openGL, and I am currently using a kinetic sweep and prune algorithm for the broad phase and then using GJK Raycast + GJK & EPA for the narrow phase. ...
47 views

### How to search through large numbers of discrete objects that interact with each other, like Minecraft blocks?

Imagine you had a world like Minecraft, but wanted to bake in some sort of physics (okay, I was playing minetest actually). For example, blocks under too much pressure might break, limiting how many ...
112 views

### How do you exactly implement a Semi-Implicit Euler type of movement in a 2D platformer?

So I've been following along Sebastian Lague's 2D platformer tutorial, and to understand exactly how the physics of how a jump is done, I dug into the subject and noticed a lot of people, from ...
23 views

### How is the density of a collider determined?

I read here that, once determining the density of a Buoyancy Effector, "Colliders with a higher density sink, those with a lower density float, and those with the same density appear suspended in the ...
30 views

### Rigidbodies gaining speed when they shouldn't

I'm trying to get the effect of a constant magnetic field on a charged particle. A really important aspect of this is that the magnetic field doesn't do any work on the particle, which in this case ...
524 views

### When setting Rigidbody.isKinematic true collider won't work anymore

I have a rigged 2D character and used Collider2D/Rigidbody2D/HingeJoint2D to body parts to implement ragdoll. It works fine, but I needed to run ragdoll physics only when character is dead. So I made ...
118 views

### Aerodynamic Physics

The current unity physics engine is limiting in the sense of drag. It's just not good enough. After a lot of internet sailing... I found this post. https://stackoverflow.com/questions/49716989/unity-...
81 views

### Game loop stutters

I have the following game loop: ...
91 views

### Calculating spaceship course

There is an idea for (soft) sf strategy game following me for a long time but I need to get a grasp of some math before moving further with it. Lets assume there is a spaceship traveling (in space) ...
103 views

### Rolling a circle around a square

I am stuck on a simple Box2D task. I have a box and a ball (in top-down view so no gravity), and I would like the ball to roll around the box. Here is my code. Basically now I am trying to detect ...
158 views

### How to calculate the torque required to rotate rigid body about constant axis and rotating axis?

How to calculate the torque required to rotate rigid body about constant axis and rotating axis? Convention: Identity Rotation Matrix: ...
179 views

### Where and how should I check for collision in multiplayer game?

I'm making a multiplayer game. For now, I added a script to towers and I have booleans to change using OnTriggerEnter. When triggered, client sends a message to server and towers health starts to get ...
185 views

### Friction using delta time returns inconsistent result

Slowing down a character using the following formula returns different results depending on the frame rate: ...
226 views

### Character moving without control

i've been developing a third person adventure game on Unity with a grappling hook and i found a problem that i don't understand and it's driving me mad. Basically, if the player character collides ...
179 views

### How to stop my cube collider when it hits another collider using Transform.Translate?

As we know, Transform.Translate() ignores collisions. What functionality do I need to add to my code so that when my collider hits something, the physics system ...
50 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 ...
124 views

### How to interact spheres with random walls

I have a physics problem to deal with, I am asking here because a game developers often uses the efficient method. I have randomly distributed circles interacting to through Lennard-Jones potential or ...
82 views

### Applying multiple forces on a particle

If I have a particle, say in a polar coordinate grid, and I want to apply multiple vectors to it, how can I calculate where it's final position will be given those vectors? Ex. Imagine there's a ...
222 views

### How do I make both the Standard Unity Sphere and Pro Builder Sphere behave the same way?

I recently got into Unity and have been developing a game with a co-worker. Long story short I was thinking about using Blender for the 3d models but found about ProBuilder and gave it a shot. Here's ...
87 views

### Detecting a Collision Between Two Bodies Undergoing Multiple Transformations

I have been searching for an answer to this for a really long time and I have not found any definitive answers as of yet. What I am trying to do is determine if and when two bodies collided between ...
39 views

### Box collider has different behavior in 2 clients

I'm new to Unity. I am making my first Game and faced with problem. I have a plane and 4 gameobject that has box collider surrounded this plane. there are a few spheres as players inside of the plane....
418 views

### How can I avoid jitter when working with a 2D movement system?

How can I avoid jitter in Unity? Let's suppose that I want to create a 2D movement system using a Rigidbody 2D(Dynamic), and I want make the camera follow the character (which is a pixel art sprite)....
1k views

### How to get one KinematicBody2D to push another?

I am working in Godot 3, where my player is a KinematicBody2D. When I collide with a block which is also a KinematicBody2D I'd ...
153 views

### Unity Graphics.DrawMesh equivalent for Physics?

I'm working on something where the same graphics mesh is rendered multiple times in the scene. The problem with this is that each of those graphics items have a physics mesh which isn't there in the ...
137 views

### Avoid object from bouncing non-stop after AddForce() is applied to it

I want to implement some sort of elastic field on my light blue magnetic field when a cylinder is colliding it, it worked except the lines won't stop bouncing. I am enabling the trigger collider on ...
58 views

### Center of Mass for Convex shape in 3D

For an arbitrary convex shape in 3D, how can I calculate its center-of-gravity? I have face-normals, and the vertices for each face. @Ocelot No, it most certainly is not the average of the vertices, ...
21 views

### How to determine angle of incidence, resulting position, and resulting velocity for a point with position and velocity appearing within a rectangle?

I have a rectangle positioned on a 2D Cartesian coordinate system, and its minimum x and minimum y are represented as a coordinate pair (xrect, ...
498 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 ...
28 views

### Deformable meshes based on torsional spring

I am trying to learn physics-based animation thanks to the book "Foundation of Physically-Based Modelling and Animation". They introduce the mass-spring model for deformable meshes. Although making ...
183 views

### Game object appears to accelerate too slowly

thank you for checking out my issue! I am trying to develop a game in java, but I have run into a problem. I would like to keep the physics as realistic as possible, so I am using a fixed time-step ...
94 views

### Converging at position and angle using motor-based rigidbody movement

I am given a rigidbody positioned in $\mathbb{R}^2$. It is a box of length $l$ and height $\epsilon$. The position of the box's left center is described by $\vec{p}$, and its angle from the x-...
47 views

### Why is my velocity increasing instead of decreasing?

I am learning to use point effectors in Unity! Now I have a sprite that is being effected by this point effector and it all works fine alone. I have introduced the following code to give the player ...
522 views

### Detecting overlap with Phaser P2 physics

In a 2D platformer, I'd like to implement a ladder. I have collision working between the player and ground tiles. Now I would like to be able to detect when the player walks through a ladder tile (...
137 views

### How can I simulate physics on my curved LED strip?

I have a LED strip with 300 LEDs that I can control one by one: https://github.com/cipold/pyledstrip You can think of them as Adafruit NeoPixels: https://www.adafruit.com/category/168 I have code ...
114 views

### Ringworld character controller

So, I'm making a sort of physics simulation in Unity involving a spinning ring to generate "gravity", and I have the ring and everything, but I've hit a snag: I have no idea how to make a character ...
158 views

### Dynamic rigidbody and kinetic with simplectic integration for trajectories [2d]

Okay, I have the following situation: I want to launch a GameObject into orbit of a planet and using the dynamic rigidbody everything is working as I want. I simulate gravity and as it hits the ...
541 views

### Rotating RigidBody2Ds in Godot

I am practising programming games with the Godot Engine and I've been having some issues with RigidBody2Ds. In this case I have a ...
428 views

### Unity - How to calculate max distance (range) of a Projectile taking drag into account?

I am able to calculate the projectile max distance, but it only works when there is no drag applied on the spherical projectile. I used the formula for range of a projectile as follows:- ...
384 views

### Box2D simulation running slower on lower FPS(even when the desired FPS is lower than the actual)

I´m playing around and trying to make myself an easy platformer using the Box2D physics, before that I was not using it and was using my own physics implementation(just simple movements with timestep)....
669 views

### How should the physics be on an halfpipe like in a skate game in Unity?

I am making a inline skating game. My player is skating based on the normals of the surface of the ground. But when I skate up a halfpipe it flies in the Air but doesnt comes down like it should be, ...
494 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 ...
41 views

### Weird issue in collision resolution of non-static bodies

I'm a bit of a beginner in engine development, so I decided to write my own engine from scratch so I could learn more about what happens under everything. I've been progressing fairly well, except ...