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
1answer
89 views

Have body resume constant velocity after collision

I want to have a body move at a constant velocity, but react to collisions. My example game is a train, I want it to move at 1 meter a second. If an obstacle appears on the tracks, I want it to react ...
0
votes
0answers
11 views

ammo JS physics : Collision happened but not resolved

I have rectangular cubes which can only move in XZ plane and rotate about Y axis. The problem is that sometimes when I apply impulse to one of them, and when collision occurs, sometimes its not ...
1
vote
0answers
20 views

How to make a catapult work with physics and colliders?

This should be my final question regarding getting a catapult to throw something in unity. On my last question, someone suggested starting with something simpler (which I apologize for not doing ...
1
vote
1answer
176 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 ...
0
votes
1answer
26 views

Predict future position of a moving body in Phaser arcade physics

I am looking for an equation for predicting the future position of a moving arcade physics body in Phaser 3. The body has drag applied and isDamping set to true. Phaser applies the drag using the ...
0
votes
0answers
41 views

How to stop a decelarating object?

I am programming a 2D game. When a ball is launched it should decelerate and eventually come to a stop. I have implemented the deceleration part but when the ball nearly stops it starts accelerating. ...
1
vote
1answer
29 views

How do you make objects be pushed away from you?

like pain from naruto, I wanna be able to press a button and be able to push objects here's my push method ...
0
votes
1answer
69 views

Rendevouz Calculations

Say you have two objects in a vacuum with no forces acting on them. The objects may or may not be moving. Object A's acceleration is not equal in all directions, and object B may change its ...
0
votes
1answer
27 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 ...
1
vote
1answer
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 ...
0
votes
1answer
134 views

Verlet rope between two moving points connected with a spring joint?

I'm connecting two moving rigidbodies using a spring joint in Unity. Between them, a rope will be rendered using a line renderer and I want it to move realistically as the joints move, without physics....
3
votes
2answers
578 views

Calculate laser bounce inside polygon

I am trying to calculate the reflection of a laser within a polygon. My current calculations are probably quite long-winded because I'm building on line intersection and other functions. The problem ...
0
votes
1answer
66 views

Unity Springjoint2d - how to put collider between anchors?

I want gameobjects to bounce off a line between 2 springjoint points. I placed boxcollider2d (with small Y scale) or edgecollider2d between two Joint points and every frame put it in right place, set ...
2
votes
1answer
120 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 ...
10
votes
3answers
4k views

Preventing a Combination of Rigidbody Jump Force & Bounce Magnitude in Unity3D

I'm building a fairly simple marble racing game in Unity3D. The ball is a 3D physics object that moves only on the X and Y axes. It has the ability to roll left and right, and to jump. Pretty basic ...
2
votes
3answers
378 views

How can I make the player slide when he does a 180 degree turn?

I'm making a roller skating game and I would like to player to skid or stop moving skating when they try to move in the opposite direction of their current one. But I'm not sure how to go about this. ...
0
votes
2answers
74 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 ...
0
votes
1answer
209 views

How to deal with VBO and obj files for physics simulation?

I'm having a hard time struggling with obj files and clothing simulations. I first made the obj file processor class that deals with the typical obj file problem: having multiple indices for vertex ...
0
votes
1answer
29 views

Moving object with preset timelapse

I am a newbie game developer. I have one problem. Consider the following case. I have a simple game with only one object - a ball. A ball can move only up and down from one side to another. A User ...
6
votes
2answers
7k 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) ...
1
vote
2answers
182 views

Friction using delta time returns inconsistent result

Slowing down a character using the following formula returns different results depending on the frame rate: ...
0
votes
0answers
35 views

How to weld nearby mesh collider vertices together to erase seams in Unity?

I'm using Unity 2020.3.2f1 and I have a very commonly seen problem. I have a Spherecollider which I am using for a physics game, and geometry that uses ...
0
votes
2answers
312 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 ...
0
votes
0answers
10 views

Unity 2d overlapCircle melee combat issue

I have an issue with my overlapCircle melee combat in the game. I'm not good at such things, so I just copied that code from some YouTube tutorial. But the thing is ...
1
vote
1answer
127 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 ...
1
vote
2answers
830 views

How to get the point of collision in Separating Axis Theorem?

I'm interested in the relatively precise point (not line) of collision for calculating angular velocity on impact for use in a impulse calculation. At first I thought, perhaps naively, that I could ...
0
votes
1answer
24 views

How do I adjust my rigidbody velocity on a local axes?

I have an fps rigid body script, code listed here: ...
0
votes
1answer
153 views

Colliders slightly intersecting each other; any solution?

Consider this simple scene: In Unity, colliders slightly intersect each other. Typically, this isn't a problem. However, I want to make a custom character controller using a box collider and not a ...
8
votes
2answers
12k views

Get collision details from Rectangle.Intersects()

I have a Breakout game in which, at some point, I detect the collision between the ball and the paddle with something like this: ...
1
vote
2answers
520 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 (...
0
votes
0answers
19 views

Calculating the bouncing ball bounce height while on platforms

I tried to calculate the bounce height for the bouncing ball however it ends up shaking against the moving platform after it finishes bouncing. grav_val in this ...
33
votes
11answers
73k views

In Pong, how do you calculate the ball's direction when it bounces off the paddle?

I'm trying to wrap my head around this very Hello World-y problem in game development. I've created a TicTacToe game in XNA so I guess the next step would be a Breakout clone. Keep in mind that I ...
3
votes
1answer
1k views

Gravity and Jumping in Clickteam Fusion 2.5

So I'm currently building a bare-bones functioning game that involves simple platforming. Quite literally a box moving left and right and jumping. I'm using Clickteam Fusion 2.5, and I know there's an ...
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 ...
1
vote
0answers
40 views

How can I calculate the inertia tensor of a hollow object defined by a triangle mesh?

I want to calculate the mass, center of mass, and inertia tensor of player created objects. Some of the objects will be hollow instead of solid. I am creating a closed triangle mesh for their object. ...
1
vote
1answer
723 views

How would joints work in an impulse-based physics engine?

I want to learn about physics engines, especially impulse-based ones. So I've followed along this tutorial to create some simple rigid-body physics: http://gamedevelopment.tutsplus.com/tutorials/how-...
0
votes
1answer
171 views

Preventing overlap in OnCollisionEnter2D

So I have successfully built a script that can determine the physics for a ball reflecting linearly off of walls, similar to pong, while the ball is using a kinematic rigidbody. The issue is when the ...
0
votes
1answer
35 views

Problem with calculating velocity for a car with multiple gear ratios

I hope this is the right place for this but I have a problem with calculating velocity for my car game. The higher the gear, and therefore lower the gear ratio, the lower the top speed. Given that ...
1
vote
1answer
1k views

Cocos2dx+Chipmunk: Fully elastic collision between moving bodies

I'm using Cocos2dx and the built in Chipmunk physics engine, and currently I've got my PhysicsBodys' materials set up with: Density=0 Restitution=1 Friction=0 in ...
1
vote
1answer
379 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)....
0
votes
2answers
69 views

How do I set the size of a single 'unit' in my game?

I'm currently trying to remake/port an old game created on Unreal Engine 2.5 to my own engine, and I have access to its physics data. It's using a scale of 80 units per meter, or 1 unit = 1.25cm. The ...
1
vote
1answer
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 ...
0
votes
1answer
86 views

How do I get my sprite to do a regular jump instead of jolt up?

I have been getting into game development and I have made some progress. I have come across an obstacle which is jumping I managed to get the Jumping to semi work but it doesn't look like a jump but ...
0
votes
0answers
21 views

How do I correct the turning effects on my car in order for it to turn properly?

In my game, I'm currently working on a Physics-based car driving game in Unity from scratch. My problem is that whenever I press the input controls used for turning, instead of turning, my car does ...
3
votes
1answer
293 views

C# XNA colliders, physics, inclined plane/terrain/colliders

Currently I'm working on a project to learn game programming. But I'm not sure if I have the right approach on several things, and that's what I'm here for. What I'm trying to create is a small world ...
0
votes
2answers
112 views

Moving ship to new destination when already having a velocity?

Feel free to skip to the bottom and see the actual question. NOTE: Question updated below based on comments I am trying to make a space game and implement basic movement, unlike most, this is a ...
0
votes
1answer
289 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 ...
1
vote
0answers
30 views

What is closing and separating velocity in Ian Millington's game physics book?

I'm working on a physics engine in C++ and chose Ian Millington's Physics Engine Development book as a guide and reference to help me out understand physics concepts and how to implement them. ...
0
votes
1answer
741 views

PhysiJS and objects on top of moving objects

Using Physijs which uses ammo.js. I am attempting to simply place a sphere on top of a box, the box is moving back and forth and I want the sphere to move with it while also being able to move on top ...
1
vote
1answer
486 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 ...

1
2 3 4 5
43