# 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,158 questions
Filter by
Sorted by
Tagged with
81 views

### Assigning relative force to a projectile fired while orbiting a sphere

Projectile Not Correctly Inheriting Parent Velocity (Unity3D) So I am trying to incorporate the above person's changes into a script I am making although I'm no great coder and I'm not even sure ...
286 views

### how to move object in a circle around point?

There are two controllable objects orbiting around a centre block. Unfortunately, I don't really know how to stick them so they can only move around the block (left/a sends them clockwise, right/a ...
27 views
+50

### Godot cutout animation with skeletons and ragdoll physics

i'm following the tutorial for cutout animation, but also wanted to combine ragdoll physics from this video, my goal is to make a 2d fight game with this 2 techniques. but not sure how to combine them ...
15 views

### How can I make a wheel spin more freely using joints in Unity?

I am making a simulation physics based skateboard game in Unity3D. I want wheels that will roll freely based on the physics applied to them without any animation or drive forces. I achieved this ...
27 views

### How do I make a bomb sight accurately?

On the Bombsight Wikipedia page, I get that equation. I do not understand it very well. How would I go about writing that in C#? The drag doesn't matter in my project. It's not a flight sim. I know ...
35 views

### How would I apply collision to super scaler games?

I am trying to do a game like the "Power Drift" or "Air Rescue" arcade games, where they use super scaling, but I am confused as to how to do the collision model, since all the ...
12 views

### How to ensure that a randomly-generated velocity vector moves the camera forward within a valid arc?

I spawn a camera in a scene using random coordinates for x and y and setting z=0 and orient ...
17 views

### Unity 3D - Grappling Gun not making Player lift off the ground at all?

I have the following code (based on https://www.youtube.com/watch?v=Xgh4v1w5DxU but tried to convert to work with world space points for Third Person Character usage): ...
43 views

### Stop 2D platformer character from sliding down slope

I'm making a 2D platformer game with the default Unity 2D physics. I am implementing slopes, but my player slips down the slope because of the physics. Here is the code I use for the player movement: ...
110 views

### How to predict where the soccer ball should be intercepted by an AI player after being kicked?

This question has been asked many times before, but most of the answers give solution to the problem where ball (target) is assumed to be moving at a constant velocity. In my scenario, I'm making a ...
31 views

### How to implement roly poly like physics in 2D? [closed]

I want to make a 2d character with roly poly like physics. I tried using Hinge Joint and other joints but results are not correct. Can anyone help me to understand how can I achieve it? Thanks.
49 views

### How to decay sine or cosine wave so it takes one additional period to reach equilibrium

In many shmups, when enemies arrive, they accelerate onto screen, decelerate, and overshoot their static arrival position slightly, before backing up slowly to the position. This can be seen in many ...
52 views

### Stretch line on bow using touch

I have drawn a line on sprite representing the string of a bow. I want to stretch it with finger touch input, using onTouch. I have added a Physics body but I don't ...
318 views

### How can I move and rotate an object along with another using vector math?

How can I move and rotate an object along with another using vector math? This is using Godot 3.1 using a KinematicBody2D as a ship with a ...
390 views

### Implementing a wheeled character controller

I'm trying to implement Boxycraft's character controller in XNA (with Velcro Physics), as Bryan Dysmas did (minus the jumping part, yet). My current implementation seems to sometimes glitch in between ...
30 views

### Box selection with Physics2D.BoxCastAll is mirrored when selecting in the bottom half of the screen

Using Physics2D.BoxCastAll based on rectangle is working fine when drawing is started on the top part of the screen, but when drawing is started on the bottom you can see this strange mirroring effect....
35 views

### Instantiated entities don't collide with each other

I've started to learn DOTS some day ago, and decided to create a simple project. When I added some simple physics to the game I faced the problem. I added one object on the scene and another ...
88 views

### Rotation of a 3D ball on a plane

This used to be on the physics stack exchange but I was told to put it here: I'm making a game (with physics) and I have a 3D ball rolling down a flat plane. It moves perfectly fine, but the rotation ...
900 views

### 2D physics library that supports curved surfaces and inverse or boolean shapes?

I've been using box2D for a few months, but I now badly need a physics library which can use boolean shapes (ie; cutting a circle out of a square) and/or curved surfaces. Does anyone have any ...
37 views

### Contact friction for overlapping rectangles

I am currently developing a top-down "tabletop simulator" where you are able to drag, drop and rotate playing cards on a table. The cards are able to overlap but do not interact as of yet. ...
17 views

### How to make a variable height jump controlled by parameters?

I'm trying to make a variable height jump controlled by parameters. I want to be able to specify the max height of my jump, and a time to max height. I also want to be able to specify a min jump ...
154 views

### Collision detection / physics for simple game

I am currently working on a mini game for class (first time doing something like this) and I don't really know how to start with collision detection at all. The game I'm creating is a top down sumo ...
81 views

### Calculating new Velocities of split Physics Body

Given a Physics body with all his properties i want to break the body into two or multiple parts that keep the original velocities. for linear velocity this should be original velocity + centrifugal ...
1k views

### Physics-based marble race: how can you minimize the gap between first and last?

I'm building a 2D sideview marble game, where they race down the track via gravity. The problem is that once one gets ahead of the others, it usually wins. In racing games, they can address this by ...
1k views

### Why is my RigidBody2D not moving in Unity?

My problem is when I am pressing A or D, the player does not move. It is very stupid I am sure as you are, but I can not find what I am doing wrong. I could have achieved the effect I want with the ...
35 views

### Collider for Unity Line Renderer

I have several line renderers that are using as gas pipelines. A user can select one end of the pipe and attach it to one connector. Now the problem is some pipes (line renderer) are overlapping and ...
145 views

### How to make a moving platform in Godot not be affected by collisions?

I am trying to make a moving platform in Godot (for a 2D platform game, but I suspect the issue would be similar in 3D). Basically, both my player and my platform are KinematicBody2D, and they move ...
753 views

### Reduce bounciness of dynamic bodies in Box2D

In my 2D platformer game my player character is modeled using a Box2D dynamic body. One thing I thought feels off though is that even though the restitution of the fixture applied is zero, the player ...
124 views

### I am having trouble with gravity in my game

I am trying to detect if the player is on an object with a tag "canHoldWeight". But the detecting if the player is on an object isn't working. falling code called every tick: ...
76 views

### How can I allow the rope to correctly interact with Box and Polygon colliders?

In order to build 2d rope physics in my game, I download the github project from Jongallant in this link. In my game, I want the rope to collide with objects with different types of colliders such as ...
84 views

### Does friction only apply in opposite direction of motion?

Let's say an object is sliding on a slope and is the object has a velocity of (0,0,5). The friction would be acting in the opposite direction of motiong, being (0,0,-1). However, gravity is also ...
83 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 ...
11k views

### Acceleration Based Player Movement

Ok, so I am making a first person shooter game and I am currently working on movement that looks and feels good. I want to incorporate acceleration based movement for the player so that he has to ...
334 views

### How can I access an OpenGl buffer from within a GLSL 330 shader?

I am currently attempting to create a simulation using OpenGl's GPU acceleration for both the simulation computations and rendering. The rendering portion of my simulation is complete and working, but ...
276 views

### Make objects stack in unity?

I have two kinematic rigidbody cubes from the standard 3D objects, I have also enabled contact pairs mode to "all contact pairs", how do I make it so that no matter what angle they collide ...
40 views

### Add inertia to Pawn movement

I've just started to learn Unreal Engine 4.26.2 while developing an Atari Pong clone. This is how I have implemented the Paddle's movement (but this implementation doesn't accelerate or has inertia): <...
18 views

### How to connect a UPhysicsConstraintComponent of an AActor to an FKSphylElem (capsule body) of a ragdoll?

I'm trying to connect an Actor's UPhysicsConstraintComponent to a capsule body of a ragdoll. The reason I do it this way, instead of just using sockets on the ...
2k views

### 2d engine/library for android in C#

I'm looking for a good 2d engine or library (that supports physics) for Android. I have a restriction - language should be C#. It's not a requirement to use Mono Droid, but it seems that it is an ...
2k views

### Getting started using C# and Physics (Resources, Tutorials, Samples, etc.) [closed]

As an application developer, I plan on now getting started in game development so I have come along to this site. I am a proficient C# developer so I guess it makes sense to start game development in ...
2k views

### Are game programmers aware of all the physics derivatives?

I am trying to study XNA for game programming. XNA has many methods that can simplify developer's life, such as reflecting the vector when it hits a solid plane. I know these are good and developers ...
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 ...
5k views

### How do I simulate the Doppler effect in a game?

I am trying to simulate the Doppler effect in a game (a car racing game). I am not using a specific sound library that simulates the effect; I only have a callback function where I mix the data. I ...
865 views

### IndexOutOfRangeException on World.Step after enabling/disabling a Farseer physics body?

Earlier, I posted a question asking how to swap fixtures on the fly in a 2D side-scroller using Farseer Physics Engine. The ultimate goal being that the player's physical body changes when the player ...
230 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 ...
1k views

### Farseer - Apply Impulse

I'm new to Farseer and have a simple question. The demos I went through didn't seem to demonstrate what I want. I would like to apply an impulse (not force) to an object at a specific position on that ...
262 views

### How do I make a tile passable in one direction only?

I want that my character can jump through some of the tiles, like Mario does in this video: http://www.youtube.com/watch?v=zIPYzbNrNhc In this video, Mario jumps up through orange platforms, but ...
26 views

### Make platformer character stay in the air at the top of a jump

I have a player who can jump. I want the character to stay in its position and not fall to the floor. This is the code I am using so far: ...
327 views

### How do I get an object to rotate in world space via RigidBody.AddTorque?

I'm getting really discouraged because I can't seem to figure how how to rotate my object via Rigidbody.AddTorque like it is on a figurative global turn table rather than a local turn table. Another ...