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
3
votes
2answers
492 views

What is transmitted over the network during multiplayer first person shooter games?

In games like Half-Life 2, Team Fortress 2 etc, when you play against other players online, your local game communicates with a game server. If you've built one of these games, what sort of ...
5
votes
4answers
2k views

Lunar Lander calculating gravity, acceleration and collision in GameMaker

I've already asked this on the GameMaker forums but had no response so far. I'm making a little Lunar Lander game as my first foray in to GameMaker, I'm wanting to have the ship land and take off ...
0
votes
1answer
64 views

Top-Down Tank Physics with Pygame

I am trying to make a top-down tank shooter game in Python and pygame, but I can't get the tank movement right. My objective is to make it move forward in the direction it is pointing in which would ...
0
votes
1answer
56 views

Speed after an angled collision?

I can calculate the speed when there is no angle, but I can't calculate the speed when it is angle. Physics paramaters: ...
0
votes
3answers
3k views

2D Physics friction on a moving platform?

I have a few basic platforming mechanics going on in this scene. I have a prefab platform with an animation that loops back and forth between two different x positions, but does not begin looping ...
0
votes
1answer
443 views

Change sprite angle on sloping ground

I have a problem here with GameMaker built-in physics environment.My player is designed to be on a skateboard. I want my player to rotate its sprite, according to the kind of fixture(up or down slopes)...
0
votes
1answer
48 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 ...
1
vote
0answers
44 views

How to make Player consistently jump *to* a specific target rather than *towards* it?

I'm trying to make it so if my player hits "E" then they jump precisely to a specific target. The current code results in player jumping towards the target but not really making it there. I'...
0
votes
1answer
1k views

2D/3D Soft body physics in Unity

I want to implement soft bodies in my game similar to this link. I tried using this Soft body simulation plugin but it has the following problems: Only works with box colliders. Doesn’t work with ...
1
vote
1answer
34 views

How to calculate the force for the fragments correctly?

I have a wall on which you can shoot cannonballs from a cannon, after hitting, I replace the wall with fragments of it. How to correctly apply force to the fragments of the wall after being hit? ...
0
votes
1answer
158 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 ...
1
vote
1answer
39 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....
0
votes
1answer
84 views

How could I move an object, while respecting the gravity and other related physics in Unity?

How could I move an object, while respecting the gravity and other related physics in Unity? I tried using the following approach: ...
0
votes
1answer
78 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 ...
2
votes
1answer
86 views

Should delta be applied to every change per frame ? (e.g. acceleration, deceleration, jump, etc.?)

I have written a game based on another game's original physics. I have all the constants the original game used in the Sega Megadrive. For example: ...
2
votes
1answer
589 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 ...
0
votes
2answers
151 views

How to use AddForce on a capsule?

I created a simple scene, with a box that serves as the ground, and a capsule that serves as the player. I added to the player a RigidBody, and a component that should move it using AddForce: ...
4
votes
4answers
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 ...
0
votes
1answer
68 views

Why is JumpHeight of 7f not visibly lifting Player off ground?

I'm using this code for Jump but when Space is hit, the character looks like they don't move. I played with JumpHeight and it turns out the jump does work; it just takes like 50f for it to finally ...
0
votes
1answer
20 views

How to detect all vertices within collision Area?

Using collision detection algorithms such as MPR (Minkowski Portal Refinement), GJK (Gilbert–Johnson–Keerthi distance algorithm), you can calculate the penetration depth in the collision. For 2 mesh ...
1
vote
1answer
42 views

Making Sprite Movement Appear More Natural

Currently I have a 2D game in which the player and a computer controlled (non-player) sprite move from point to point collecting tokens in a continuous environment. The player and the non-player ...
0
votes
0answers
10 views

Can't move up the CharacterController after applying gravity

I'm making a player with CharacterController and having trouble with handling gravity. Here's the code: ...
3
votes
2answers
122 views

With gravity enabled, how do you move a RigidBody forwards at a specific speed?

I have a perfectly smooth cube on top of a perfectly smooth plane. I am applying a forward-force of 1 unit per second, using ...
0
votes
3answers
521 views

Jittery collisions in Unity 2D

I tried to implement a simple movement to my object. My object moves perfectly fine but I'm having issues with its collision. When I keep on moving object towards the obstacle/ground, collision are ...
1
vote
1answer
20 views

A concise set of equation of physics that handles basic 2d physics for acceleration?

I am making an Asteroids clone and I want to implement proper physics for the objects. What equations would I use to calculate the acceleration? For example, I have a ship, and it might have ...
0
votes
2answers
133 views

How to calculate the post Rigidbody2D velocity vector before applying a specific force in Unity?

I am trying to implement a space rocket in 2D. Whenever the player presses a button, a constant force (Both vertical and horizontal) is being added to that rocket. What I want to add is a maximum ...
1
vote
1answer
94 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 ...
1
vote
0answers
46 views

Why do large creatures in some games seem like they have no mass when rotating? [closed]

Why do large characters/creatures in some games seem like they have no mass, especially when the pivot on X axis to change their heading? Imagine a space game where there is a large ship. Typically ...
0
votes
1answer
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 ...
0
votes
1answer
293 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 ...
1
vote
0answers
48 views

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 ...
0
votes
0answers
25 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 ...
0
votes
0answers
16 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 ...
1
vote
0answers
26 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): ...
0
votes
1answer
103 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: ...
2
votes
2answers
120 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 ...
0
votes
0answers
54 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 ...
0
votes
1answer
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 ...
0
votes
2answers
356 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 ...
2
votes
1answer
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 ...
1
vote
1answer
38 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 ...
0
votes
1answer
92 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 ...
5
votes
3answers
905 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 ...
0
votes
1answer
38 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
0answers
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 ...
0
votes
1answer
158 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 ...
1
vote
1answer
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 ...
3
votes
2answers
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 ...
0
votes
1answer
40 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 ...
2
votes
1answer
157 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 ...

1
2 3 4 5
44