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
21 views

Numerical errors in Player collision offset causing player to fall through the ground the next frame, how to avoid?

I'm trying to implement player physics with arbitrary objects, in this case, a bunch of cubes. I wanted to add a "floor" so in my cube collision function, I added the following following lines: <...
0
votes
1answer
27 views

In Godot, how to make a Kinematic body affectable by rigid bodies?

Background Info I'm currently following the FPS tutorial from the official site. By the end of Part 1, there is a Player object implemented as a KinematicBody and ...
0
votes
1answer
33 views

Controlling a balance wheel using a Unity script

I am working on a small demonstration project with Unity like this (screenshot from footage below). I don't want to use Unity physics, which is too heavy. I plan to create a rotation function with ...
0
votes
2answers
42 views

2D active ragdoll/physics-based procedural animation

I'm trying to make a 2D quadraped robot stand and walk via physics. My robot looks like this. (art is not mine. Source is vapgames) It's rigged via Unity's 2D animation package and each joint/bone ...
0
votes
1answer
39 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
1answer
56 views

Angle between character and mouse, and giving bullets velocity in the correct direction

I've been trying to work for a few days, on a little weapon system where you can aim with your mouse and shoot bullets in the direction you're aiming. This is all in 2D to be clear. Right now, I can ...
1
vote
1answer
31 views

How to set the force applied to RigidBody2D depending on the time user holds touch on screen?

I trying to make an object jump from 1 point to another point. How far it jumps depends on how long the player holds the touch anywhere on the screen. It jumps when player releases his touch. At the ...
0
votes
0answers
34 views

Implement MMO like character movement without a full-fledged physic enginge?

Question: How can I implement World of Warcraft / Guild Wars 2 / etc like player movement, including jumping, without using a full-fledged physic system for my multiplayer game since players only ...
3
votes
1answer
40 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 ...
2
votes
1answer
26 views

Unity Jumping bug

I'm working on a basic movement system for the player in a 3D Box platformer and for a month I've been having problems with the double jump system. The one bug that I still can't figure out is ...
0
votes
2answers
48 views

Objects aren't rotating in sync

This is a follow-up question to How to reapply force applied to one object to another object I want to make two objects move, react to collisions and other stuff as if they were one. For example, ...
0
votes
2answers
39 views

How to reapply force applied to one object to another object

Edit: While I wasn't able to make the code work completely, I believe my question has been sufficiently answered. I want to make two objects move, react to collisions and other stuff as if they were ...
0
votes
1answer
36 views

how to calculate resulting velocity and angular velocity rocket has on center of mass

The issue i am having is that i can't seem to figure out how to apply force from a rocket to a bodies center of mass. *Edit This is in 2D e.g. Let's call the body 'ship' the 'ship' is 1000 (...
1
vote
1answer
98 views

How to make a smooth projectile in roblox?

I am trying to make a projectile (Energy ball) for my game. I am using body velocities, but the issue is is that it seems laggy. I shoot it then half a second through flight it seems to stop in mid ...
3
votes
0answers
67 views

Faster convergence in a physics engine

I've got my hands on the first edition of the book Game Physics Engine Development: How to Build a Robust Commercial-Grade Physics Engine for your Game by Ian Millington. Because I didn't really know ...
1
vote
2answers
122 views

How can I adjust the speed my character jumps at?

I've applied this method How to make a character jump?, like: ...
1
vote
0answers
58 views

How to calculate the torque required to rotate rigid body about constant axis and rotating axis?

How to calculate the torque required to rotate rigid body about constant axis and rotating axis? Convention: Identity Rotation Matrix: ...
0
votes
0answers
7 views

MatterJS Trigger Mouse Input Programmatically Server- Side

So I want to create a simple multiplayer game using MatterJS. The game is basically you have a slingshot and a ball, you drag the ball and when you release the ball flies (like Angry Birds Basically)....
0
votes
0answers
50 views

Unity: Make a moving rigidbody stop exactly at a given distance

I have an object that only moves along Z-axis, its rigidbody has a mass of 1 and a drag of 0.2. That object accelerates till MaxVelocity and then moves at that constant velocity in the Z-axis. When ...
1
vote
1answer
47 views

Unity2D force of an impact

I don't know how to name what I am searching for... Force, Impact? It's easier to explain with an image for me. We have two GameObjects with colliders, A and B. They can move in any direction (top ...
0
votes
0answers
22 views

Unity Tilemap collider stopping player's movement [duplicate]

I am using tilemap collider to create collision between my world tilemap and the player, but sometimes when the player runs on the tilemap, it stops the player's movement and kind of makes it look ...
0
votes
1answer
31 views

Character blocking when walking on cube edges

I have my character walking on a ground made of cube. (scale 1,1,1). There is no space between them. Also, I have a RigidBody with 15 drag and I'm moving with <...
0
votes
1answer
39 views

OverlapBox() dimensions are huge but are fine when tested in isolation

To be completely transparent, I more-or-less copied this question from the Unity forums since I did not get a reply. I'm creating this system where I'm placing level chunks together and I need to ...
0
votes
1answer
19 views

Unexpected velocity changes in unity

I have a character that moves with a rigidbody. When I jump, it looks fine, but sometimes, my character boosts up while in the air and shoots out of the map very quickly. I checked, and when it ...
0
votes
0answers
20 views

Make suspension for Car using Matter.js

I'm attempting to recreate a Hill Climb Racing game through using matter.js. However, I'm stuck on the part of creating a realistic suspension using constraints. The main issue is that the constraint (...
0
votes
0answers
38 views

How do I create interactive grass like this?

I would really like to create grass that reacts to the player's movements, so when they walk through, it moves away from them, just like this: https://www.youtube.com/watch?v=5Gc-Ue9_xgk https://www....
0
votes
1answer
48 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 ...
0
votes
2answers
63 views

AABB Collision Detection Confusion

I am trying to understand and implement AABB collision to learn simple 2D game physics. I'm following a tutorial and its method is a bit different to other websites. It uses the center of the object ...
4
votes
1answer
234 views

Making a wrapping wire (like the Worms Ninja Rope) work correctly with moving geometry

I have implemented a 2D wire like the one described in this question which is made up of straight line segments between wrapping points. However, while the algorithms described in this answer work ...
0
votes
0answers
32 views

Double jump not working on rotated object

I am trying double jump from a platform. When the object is rotated, my double jump does not work. Here is my first attempt: ...
1
vote
1answer
87 views

Unity: Bizarre Physics FixedUpdate Lag spikes

So I have this large forest of around 2M tris: Same chunk selected with view on the whole level: It's been generated within Blender and exported as fbx into Unity. Exporting each tree as an ...
0
votes
1answer
58 views

Soft Body rendering from OBJ model

As part of my master thesis I have to do an softbody simulation. I 'm using Bullet Physics engine. I'm trying to render softbody, create from Meshes, with Shaders in OpenGL but the object doesnt ...
43
votes
8answers
7k views

How can I perform a deterministic physics simulation?

I'm creating a physics game involving rigid bodies in which players move pieces and parts to solve a puzzle/map. A hugely important aspect of the game is that when players start a simulation, it runs ...
1
vote
1answer
19 views

Verlet chain with two fixed points is not converging properly

I am trying to create a simple chain between two fixed endpoints. The problem is that I can't seem to get the chain to reach a stable state. Further, the chain is always biased toward one of the ...
1
vote
1answer
34 views

How to calculate gravity with multiple bodies?

I'm looking at building something space-related, and trying to figure out how realistic gravity calculations would work. The specific question I want to answer is, if I have a sun and an arbitrary ...
1
vote
2answers
102 views

How to handle player input with fixed rate variable fps time step?

I've made a system which uses the ideas from "Fix your Time Step" in order update physics. I'm having trouble finding standard methods for dealing with this when user input affects player movement ...
0
votes
1answer
133 views

How to make a ball move with constant velocity after a collision?

In my scene there is a player and a ball a few units above the ground. The ball has a rigidbody2D attached with zero gravity. I built a "cage" with square sprites to simulate the edges. I would like ...
0
votes
0answers
44 views

Box2D with SDL2 not working properly (Collision without rotation and problems with MKS)

I already have some expirience using SDL2 so I thought I will add a Physic Engine to my game - I chose Box2D. I managed to setup everything and to build a small program using SDL2 and Box2D. But now ...
3
votes
0answers
43 views

Force propagation through physic bodies constraints (as non-penetration)

First, some context I'm currently implementing a (well, tiny) game engine using a predictive approach. The idea is to compute when a state change will occur, and only update state at time of the ...
1
vote
0answers
47 views

Where and how should I check for collision in multiplayer game?

I'm making a multiplayer game. For now, I added a script to towers and I have booleans to change using OnTriggerEnter. When triggered, client sends a message to server and towers health starts to get ...
0
votes
1answer
42 views

How does a custom physics engine connect to a tile graphics engine?

I’ve been looking into adding physics to my tile based side scroller game, and it seems like the best option might be to write my own engine to handle things like collisions and gravity due to the ...
0
votes
2answers
33 views

Adding some new velocity to player in FixedUpdate. Should I use FixedDeltaTime or nothing?

I am trying to learn how to move objects in Unity without using the built in features like AddForce etc. Some tutorials on Unity website (and other places) is where I have got most of my 'knowledge' ...
0
votes
1answer
53 views

Why is my player still moving down when I set its gravity to 0?

I'm writing Lode Runner like platformer game. I'm trying to solve player sprite slowly moving down when on ladder by setting player.body.gravity.y = 0. I have ...
0
votes
1answer
36 views

What to call an Object that falls only when it's collided with?

I am currently working on Objects/Blocks for my 2D Jump'n'Run. Now I want to add a new type of block, which falls down only if the player/an actor collides with it. But I don't know what to call this ...
1
vote
2answers
62 views

Calculate position given velocity and acceleration at a given timestep

I am following a Pixar course at Khan Academy and I came across a simulation of a double spring with a given timestep. I understand how it works and why it behaves the way it does, but I want to know ...
0
votes
0answers
31 views

Car physics: incorporating lateral forces for high-speed steering

I'm making a car simulation in Javascript and I am using this website to help me with the physics: http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html The ...
0
votes
1answer
65 views

Check If a 2D Collider Is Completely Inside / Outside of a Polygon Collider

How can I check if one 2d collider (circle, capsule, polygon etc.) is completely inside / outside of a polygon collider?
0
votes
0answers
34 views

Rotating a vehicle to match a 2D slope

I have a vehicle that needs to move on a randomly generated terrain and handle slopes. I'm not using wheels, but instead moving the vehicle with velocity. The ideal case would be if I can make the ...
0
votes
0answers
30 views

Generation of a 3D loop the loop with minimal steering required

How would I generate a surface which resembles a loop-the-loop shape like this one described here? After triangulation of the surface, lets say I start at one end with some initial velocity which is ...
0
votes
0answers
17 views

Best practice for frequent sending webSocket/Socketio/webRCT data [duplicate]

I already done game template for classic platformer. I use matter.js for physics and my own override draw functions. Everything works fine. Next stage is to make it multiplayer. I interest is it good ...