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.

Filter by
Sorted by
Tagged with
0
votes
0answers
40 views

Simulating linear inertia

I have an aabb (player) which can move dynamically - to get acceleration I am saving the previous previous position (through prevPrevPos, prevPos and pos acceleration will be calculated). Now I have a ...
0
votes
0answers
24 views

How to make googly eyes

I want to make googly eyes in Game Maker Studio 2 and I'm kind of close to what I want. I have a white circle object and a black circle object. When my black circle is colliding with the white circle ...
2
votes
1answer
59 views

Predicting trajectory of Box2D physics body using both: linear dumping and gravity

I would like to calculate position of physics body after some time because of predicting shots trajectory in my game. I found some great answer here where Iter Ator provides equation to calculate ...
0
votes
0answers
22 views

How do I add a third axis of movement for my character to go up and down?

My movement system at the moment is based off of a tutorial I followed. The tutorial is about moving with spherical gravity. I want to add another axis of movement so my character can fly up and down ...
0
votes
4answers
108 views

When an object is launched off-screen, is there any way to know if it's coming back?

In this scene, the object becomes invisible and then comes back In this scene, the object becomes invisible but does not come back Is there any way I can tell if an object will come back when it ...
0
votes
0answers
25 views

3D collision response advice for complex meshes

I am trying to use my own collision detection system in Unity to speed up my game. My problem is that when rigid bodies sit on top of static bodies, they will balance unrealistically on one edge or a ...
2
votes
0answers
24 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 ...
0
votes
1answer
17 views

how to do rigidbody movement relative to player rotation in unity c#?

in my game the player is to walk around a sphere, I'm using rigidbody to apply movement with a joystick like this; rb.velocity = new Vector3(move.x, move.y)* speed; ...
0
votes
1answer
15 views

How to apply forces to character with gamepad in Unity?

I've been following Brackey's tutorial on this, see the excerpt from my code below. In his tutorial it only teaches "transform.Translate", how do I use this gamepad input system tool to add ...
0
votes
0answers
27 views

How to have 3d multiple planet gravity in unity c#?

Im using unity and I want to make a game where you can walk around small planets and the further away you get, the weaker the gravity, so you can go to other planets. All the tutorials so far only ...
0
votes
1answer
30 views

How to move through a game object - while getting the normal of the initial contact

In Unity, how can I detect a collision between two game objects, but have them pass through one another, i.e. not block each other? Specifically, I need the collision normal provided by the ...
0
votes
0answers
35 views

Unity rigidbody velocity

In Unity, what is the correct way to move a game object by modifying the velocity of its rigidbody? I'm having some issues with stuttering movement, so I just want to make sure I understand the basic ...
0
votes
1answer
27 views

Capsule getting stuck on edge of block

I'm making a first person game and when I jump and my character gets close to the top of the wall, the vertical movement stops, jitters, or suddenly snaps to the top of the wall. Video Here is my ...
0
votes
0answers
15 views

objects are keep falling [duplicate]

I added some screenshots above. When I run the game obstacle are falling rapidly through y axis. So, there's no more obstacle in that ground. If there's ground than ...
0
votes
0answers
19 views

Creating a simple ripple propagation with variable resolution

I am trying to do a simple simulation of a ripple propagating through a medium. I do not have a physics engine at my disposal so setting up a complicated set of spring constraints doesn't seem to be ...
2
votes
1answer
58 views

How to calculate gravity vector based on device rotation?

I have basic scene where the cube sits on platform What I want is if the device is rotated 90 degrees to the left, cube should fall down as shown below I came up with a solution to tackle that by ...
0
votes
1answer
24 views

stop object while falling

The object have forwardForce. ...
0
votes
1answer
33 views

Need help projecting 2D projectile motion in 2.5/isometric 2D game

So I’ve been researching this a lot and have hit a road block. I’ve read pretty much every thread on here regarding this and while I understand the concept I don’t understand how to implement it. For ...
0
votes
0answers
17 views

Discrepancy in Box2D Flash applied impulse

I have two clients. Player A, and Player B. What Player B sees in his screen is a mirrored version of what Player A sees. This is a carrom game, hence the mirroring. Does anyone know why even if I ...
1
vote
1answer
37 views

Is an inertia tensor in local-space always diagonal?

I'm looking at the implementation of a physics engine and I observe that the inertia tensor of a rigid body, in local-space coordinates, is stored as a 3 dimensional vector, rather than a 3x3 matrix, ...
0
votes
0answers
100 views

Why do edges make the player jump?

I'm making a 2D platformer with Unity and I have a problem with platform edges. This problem is usually visible in the situation where I want the player to walk up the stairs by jumping, but the ...
0
votes
0answers
29 views

Slope detection in 2D platformers

I am currently shifting from unity to monogame to make 2d platformers. I am not aware of any sort of "raycasting" provided with monogame, I am aware of AABB collision detection and I am ...
0
votes
0answers
35 views

Penetration Depth into a Planar Polygon

I'm working on a self-made physics engine, and I'm wondering about the best way to calculate the penetration depth into a polygon that lies in a plane given that resolution must occur along the ...
0
votes
0answers
18 views

Dashing mechanic in top down projectile dodging game in pygame

im making a simple third person top down game where you dodge projectiles than fly in from either side of the screen, its a simple high score game where the longer you avoid being hit, the better your ...
1
vote
1answer
67 views

Integration of gravitational interaction

I don't know if this question get her place in physics.stackoverflow forum. I prefer post here, with code etc. So, I want simulate 2D movements (no rotation) of an asteroid in space affected by a ...
0
votes
1answer
28 views

Player clips into the ground when I press the restart button

The title says it all. I have a subway surfers like game prototype, where I just added a restart button that can reload the scene. However whenever I press restart the charaters gets into a slightly ...
0
votes
0answers
27 views

Trying to create a '2D 8 Ball Pool' game - Trajectory Prediction

I am trying to create a game similar to (Pocket Run Pool) https://www.youtube.com/watch?v=ewlAE6NQnsI&t=215s a 2D pool game that is much simpler than a 3D one I need help with creating code for ...
0
votes
0answers
26 views

Unity 2D softbody with custom spring

I'm trying to make custom 2D softbody physics that can interact with other Unity colliders. My starting point was to implement a custom spring joint capable of connecting two entities ("particle&...
0
votes
1answer
38 views

How to make GameObject copy position of other GameObject but react to physics perfectly?

First GO moves by transform.translate (necessary). Second GO needs to move by physics. If I do rb.MovePosition on the 2nd GO like: ...
0
votes
2answers
111 views

What's the maths behind checking line of sight

I understand in unity there is Phsyics.LineCast(Vector A, VectorB). What's the maths behind doing that, the only thing i can think of is going along the line at small intervals and seeing whether it ...
0
votes
1answer
31 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. ...
0
votes
2answers
35 views

2D physics without “rebound”

I'm trying to get my 2D top down shooter to use -some- physics. I want the player and enemies not be able to exist in the same position, in other words, use collisions. My first attempt was to use a ...
0
votes
0answers
31 views

Moving character controller on twisted track

I am trying to move a ball using Unity's character controller component. I want to move the ball along the twisted track so that it can go upside down. Below is the video of the problem when moving ...
0
votes
0answers
50 views

Rotate character

I want my player character (the feet ) to stick to the platform (like in the photo) rather than falling or following the physics. I want it to move like a spider but I am stuck. With the help of this ...
0
votes
1answer
44 views

Object to reach height depending on its gravity and mass

A mathematician will probably think this was a silly question, but I'm not one and I'm in need of help :D I'm working in Godot and with its RigidBody2Ds (objects ...
1
vote
1answer
48 views

Multithreaded callback

I'm making a multiplayer game where players fight in vehicles, and I am doubting my server architecture. As it will be physics, network and AI intensive I would like to split these 3 topics into their ...
0
votes
0answers
21 views

If statement won't work in Algodoo

I'm trying to code a if statement in Algodoo that checks if an object has a certain value in a variable called id, and if it has the correct value, it will teleport it and anything with the same value ...
0
votes
1answer
49 views

How do I stop a moving object when colliding with a static wall or falling to a static ground

I'm writing my very first 2D game engine in C++ and SDL2. I wrote a very simplistic RigidBody class that computes the resultant force, applies forces and simulates ...
0
votes
0answers
16 views

Cloth tool and Skeletal Bone Weight Paints in Unreal Engine

Just a quick question: I've got my 3rd person rigged and skinned, but I have some hanging fabric around the characters waist which drapes down to the characters legs. Should this fabric be weighted so ...
0
votes
0answers
25 views

How do I move a Unity object with velocity instead of force?

I have a 2d car in Unity that I want to move, but Unity does this using relative force & I want to use velocity. As we know if we add force, an object will move and never stop. I want to use ...
0
votes
0answers
39 views

Are you supposed to be looping through all PhysicsObjects at every step in a physics engine?

I am currently making a small 2D game and I am trying to implement some basic 2D physics. I currently have a list of around 100 PhysicsObjects which I loop through every frame in order to update and ...
0
votes
0answers
14 views

Rope 2D Hinge disconnection

I have a game that needs to use a rope-like mechanic should do two things. Restrict Player's Movement within the length of the rope. In other words, some kind of rubber band that brings the player ...
1
vote
0answers
16 views

Moving Object Interception / Projectile Collision [duplicate]

I am using Unity to attempt to have missile A launch at incoming missile B and blow it up. However in order to do this accurately, A must be able to take into account B's current velocity, direction ...
3
votes
2answers
66 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 ...
0
votes
0answers
36 views

Issue with 2d Angular Car Collision Response

I am having trouble getting the angular collision response to work properly in my 2d car simulation. I have gotten the linear collision response to work between the vehicles, however, the angular ...
0
votes
1answer
71 views

Swept 3d capsule intersection with AABB, what am I actually supposed to use to accomplish this?

I'm trying to figure out how to do continuous collision with a capsule (which would represent a collision volume for a player for example). Given how common the capsule is in many game engines, and ...
13
votes
3answers
3k views

Fixed timestep game loop, why interpolation

This is a very standard way of doing a fixed timestep game loop, where you just accumulate time from the previous frame and consume it in discrete steps with the physics engine: ...
0
votes
0answers
34 views

How to implement framerate-independent acceleration depending on current velocity

For my client/server application, I've implemented framerate-independent acceleration like this. Now I've advanced my formula to be using the current velocity of the moving object to calculate the ...
0
votes
2answers
95 views

Need help with gravity simulation in 2D game engine

I'm writing a 2D game engine using C++ and SDL2 and started implementing a rigidbody component similar to that of unity to my game objects. I have a method in the <...
3
votes
1answer
40 views

Is it possible to correctly catch up a particle system simulation based on long delta time between many frames?

I have a particle system with a physics simulation integrator based on delta time (elapsed time between frames) which is implemented on the GPU in a compute shader. I also have a frustum culling ...

1
2 3 4 5
43