Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Relating to the motion of objects through space and time. Including concepts such as acceleration (thrust and gravity), mass, collision response, friction and more.

0
votes
1answer
52 views

Make a glass cup look like it's full of water

I've been struggling to figure out a way to make a glass cup full of water, and since the cup is made of glass a plane on the top of the glasse won't really do it, so how can i go around making the ...
0
votes
1answer
31 views

Separating axis theorem OBB vs Sphere

I am trying to implement collision detection in 3D between OBB/AABB and sphere. For this i'm using sat/separating axis theorem. For sat to work in 3D i need face normals of obb (sphere to face), each ...
0
votes
1answer
44 views

What is best for 2D movement: velocity or AddForce?

So I have tried both Velocity and addForce but I'm not getting the result I was expecting which makes me wonder if I fully understand what they do. Move script (test script 1) ...
0
votes
0answers
15 views

Calculating the resulting velocity after a reflection

I am trying to do a simple reflection of a point entity off of an arbitrary surface that contains it. It doesn't have to be physically correct but essentially the goal is to do the following: ...
0
votes
0answers
10 views

Character Controller approaches for a fast quadruped

I'm working with Urho3D at the moment, which uses Bullet for physics, and I'm trying to create a character controller / physics system for my quadruped character. I'm aiming to get this character able ...
1
vote
1answer
41 views

How to synchronize moving hazards?

I am trying to implement a saw blade hazard in my platformer. The saw blade simply moves from point A to point B, and back, at constant velocity. (Let's assume all saw blades move at the same velocity....
2
votes
1answer
36 views

Jumping to land x pixels ahead while not really moving (2D)

The player object in my game has its x-axis locked. It can only jump on Y. It's the ground that constantly moves to the left so that it appears like the player is moving to the right. The ground is ...
0
votes
0answers
12 views

Unity3d ragdoll gravity issue?

I was following AnimFollow tutorial to learn how to rag without using any script from it. I found issue with gravity. When I hit play button and animator is enabled character stay on air and play idle ...
0
votes
1answer
40 views

2D Sidescroller Gravity

Ive looked up implementing gravity on several sites. Subtract a constant gravity (9.8 * DeltaTime) from the velocity each frame. My problem is, when implementing it as they say, when walking off a ...
0
votes
0answers
18 views

Unity3D Hinge Joint Ropes Unstable

I need to create several ropes to go on the head of a mop, which can be picked up and moved around as a physics object by the player. I've tried composing each thread out of several capsules connected ...
-2
votes
1answer
26 views

Why does my OnTriggerStay method throw a NullPointerException when I access the collider's attachedRigidbody?

I set the trigger void OnTriggerStay(Collider other) { other.attachedRigidbody.AddForce(Vector3.up * 100, ForceMode.Impulse); } But when player walks on, ...
0
votes
1answer
43 views

Unable to rotate a 2D object, wanting to move it like a ball/wheel

I'm using Unity2D. I have a very basic 2D space with a platform, a ball and 2D physics. Physics is being applied and ball sits on top of the platform. However, it will not spin. Below is the ...
1
vote
1answer
26 views

Unity3d Pause RigidBody object, don't stop time

Time.timeScale = 0 obviously works to stop physics but it's also stoping my Invoke calls. How can I get around this to pause ...
0
votes
1answer
54 views

Unity 2D: Inconsistent jump height in game window

Whenever I start the unity editor and play it in the Game windows, sometimes the object can jump higher sometimes it is just small jump. I didn't change any value in my script nor changed it in ...
0
votes
1answer
19 views

How to implement level-player collisions resolution?

I want to create simple collision response system (physical simulation is not required now). It is needed just that player can't go through walls. I consider some variants: - Just create a set of ...
0
votes
1answer
25 views

Choosing the correct normal for a collision

I have taken the task of building a basic impulse physics engine. Circle vs Circle collision resolution has been done and I moved onto Line vs Circle. I can detect a collision and know that the normal ...
0
votes
0answers
30 views

Physics update in a client/server architecture with different tick rate

In a game where the client would run at 60FPS and the server 20FPS/possibly 10FPS, I wonder if is possible to update the physics without losing resolution. Consider the circunstance where a character ...
0
votes
1answer
28 views

Projectile Not Correctly Inheriting Parent Velocity (Unity3D)

I am trying to fire projectiles from a player who is moving at very high speeds. The issue is that the bullets do not seem to inherit the angular velocity. If the player is moving in a straight line ...
2
votes
2answers
101 views

Top-down conveyor belt with Box2D

I'm trying to code a conveyor belt for a project made with LibGDX and Box2D and I would like to make it like this one from Bomberman Land Touch. As you can see, the entities standing on it should be ...
0
votes
1answer
41 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 ...
1
vote
0answers
90 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 ...
0
votes
0answers
28 views

Physics.IgnoreCollision not working right after invoked

When invoking Physics.IgnoreCollision in Unity, it seems work but it still have collision detection right after creation. I have this issue with ejecting empty case after gun fire, it's spawning ...
1
vote
1answer
31 views

How to “amplify” a force and physic using AddForceAtPosition?

I have the object in the image. The red box is kinematic: when an object hit it , i set kinematic to false, so Unity apply normal physic. But I would like to apply also a force to the point ...
0
votes
0answers
21 views

Rigid body dynamics : how to check if result is physically correct

I implemented rigid body dynamics according to this guide. And it kind of works. However I'm not entirely sure if the dynamics is correct when angular momentum is not collinear with axis of inertia ...
0
votes
1answer
60 views

Unity: Water shader vertex offset - how to add mesh collider which updates with vertex offset?

I have written a shader (in the new LWRP shader graph) which simulates an ocean with vertices which offset to create a moving "waves" effect. I believe that in order to have objects "float" on my ...
2
votes
1answer
103 views

Ways to include relativity in multiplayer

Im currently working on a game concept including flying Space Ships in the solar system and maybe beyond. As the ships are using similar engines than in "The Expance" Epstein Drive. relativistic ...
0
votes
1answer
42 views

Calculating displacement in physics simulation

Something's been bugging me and I haven't been able to figure this out. In a simply physics simulation, where you'd calculate a net force acting on a body every frame, calculate the acceleration that ...
1
vote
1answer
53 views

Physics - How to calculate the next position of a ball rolling against a slope?

For a small C/C++ game project, I want to add some physics on a ball, to allow it to roll against the slopes of a 3d world, in the same way as the example visible in the image below: However I have ...
0
votes
0answers
17 views

Object moving by adding force to Rigidbody bouncing off where ground objects met

I have a object that moving by adding force to rigidbody. With just big flat plane, it works fine but with connected small planes, sometimes(actually not sometimes, a lot) the object bouncing off or ...
14
votes
5answers
5k views

Why integrate over accumulation?

I'm starting to learn how to DIY physics, and I have a question about implementing integration at the most basic level (i.e. this is not a Euler vs. RK4 question). Nearly every example I come across ...
0
votes
0answers
37 views

How to include car spinout in vehicle physics?

I would like to know how I can go about implementing car spinout in games. I heard that spinout is caused by loss of traction in the rear wheels of the car but I don't know how it relates to velocity ...
0
votes
0answers
21 views

How to implement floating behavior on player character

Lets say I have a body of water with the level of the water at each frame, with waves that basicly go up and down. How would you implement the computation of the velocity to keep the object/npc/player ...
0
votes
0answers
14 views

How to create an arc physic body in Phaser?

I am trying to make a 60 degree wave attack from center, and the wave will spread from center to the screen edge, something like EMP. But not whole circle, just a sector. If using Phaser framework, ...
2
votes
1answer
52 views

Problem while creating balancing board using Unity physics

I am trying to create a balancing board using Unity Physics. Below are the steps that I followed to achieve my result and I got unexpected Unity Physics. Balancing-bar and base are connected through ...
0
votes
0answers
55 views

Collisions between two objects in 2D space

I am implementing the collisions of my game in javascript, and at the moment what happens when the objects collide is that they have their speed changed to 0. What I'm starting to want to do is to ...
0
votes
2answers
33 views

Bug with OnColliderEnter/Exit when colliding with multiple objects at almost the same time

Unity Version: 2017.4.1f1 I currently have a game with a jumping mechanic. I only want the jump to work where you're on ground, so I have planes on top of everything, which, if you are on a plane, ...
0
votes
0answers
65 views

How to let player walk on any surface (walls and ceiling) in Amazon Lumberyard?

I am using Amazon Lumberyard to create a game where the player should be able to walk on any surface be it a wall or a ceiling, but the thing is I have no idea how to do this. I tried using the ...
0
votes
1answer
98 views

Unity Tilemap one way collisions

How can we get one way collisions using Tilemaps in Unity? There doesn't seem to be much online regarding this topic yet. From this link: https://answers.unity.com/questions/1471156/how-to-make-one-...
1
vote
0answers
9 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 ...
0
votes
0answers
18 views

Player randomly “jumps” (height dependent on speed) when rolling along flat platform of great length despite removing friction entirely

The player is a ball, the "Knob" 2D primitive. I've attached my code, when rolling along, even slowly, the ball encounters some invisible surface defect, and "jumps" off the platform. This problem ...
0
votes
2answers
81 views

Speed limit for Newtonian spaceships?

I am working on a game based around Newtonian physics. Therefore there is no drag and therefore a ship will keep accelerating indefinitely if there is no counter-force acting on it. This is being ...
0
votes
0answers
55 views

Constrain x and y with linear programming

I want to make a modular 2D spaceship game. The user can use building blocks to create the ship. Blocks can be squares but also other shapes that do not fit in a grid. To calculate what thrusters ...
1
vote
1answer
75 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 ...
0
votes
0answers
26 views

Physics for multiplayer shooter

I’m making online shooter and planning to make all physics on server, should I duplicate those physics computations on a client too to be client more responsive. Could I just have no computations on ...
0
votes
2answers
24 views

Unity: Moving on global X and Z axes with respect to local Y rotation

I'm having a bit of trouble with the math on this. I'm trying to move an object forward based on it's local yaw. Ordinarily, I'd just move it forward on the Z axis locally: ...
0
votes
2answers
48 views

What does linearDamping mean in Box2D?

If I set linearDamping on a body, it's velocity will be decreased slowly, until it stops. The documentation says, that the units are 1/time, which is unclear for me. If the velocity of a body is 10 m/...
0
votes
0answers
22 views

Predict Future trajectory of object with friction and changing direction over time

I have an moving character. I know these variables: Current Acceleration (constant) Velocity Ground Friction Current Location Destination (direction of acceleration vector * arbitrary number) as ...
0
votes
0answers
23 views

Networked physic + quadtree

I have some problem with understanding how to use quadtree to divide physic world (p2.js engine btw.) and synchronize this world with clients. Here are some informations about my game: Host & ...
1
vote
1answer
57 views

Fixed timestep without physics?

I read Gaffer's Fix Your Timestep article many years ago, and have since had the impression that game code should have a fixed timestep, with only non-gameplay related tasks outside of that in the ...
1
vote
1answer
97 views

Changing CharacterController's height causes jittering issue in Unity

As title said changing height of Character Controller causes jittering issue. For example when I reduced the height of CharacterController, it seems CharacterController was floating at each frame and ...