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

Performance problem when multiple enemies are grouped up

I have enemy with simple behavior: Reach the player's current position. In game are increasing waves, which are increasing the number of enemies. But when are more enemies (like 14), and they got too ...
0
votes
1answer
45 views

How to detect which car T-boned the other in a collision?

Setup The game has cars and collisions, and I'm trying to create the following system: When a car T-bones another, the one getting T-boned is destroyed; When the cars collide laterally (usually just ...
2
votes
1answer
60 views

Game physics of tearing apart

For a game I'm programming I'm looking for a kind of realistic mechanic for simulating the tearing apart of objects. Let me explain: I have a given point p in a 2-dimensional space (possible later ...
0
votes
0answers
25 views

Box2d on authoritative server for Unity client

I'm creating a multiplayer platform and shooting game in unity, using unity2d's own physics system (box2d). But the truth is that I am quite lost in the creation of an authoritative server in c ++. I ...
0
votes
0answers
24 views

Upside down ground correction?

How would you go about making ground correction for a platformer but upside down(reversed gravity)? I used this formula: P.Y+=(P.Y-2)%8-1 but the character just ...
0
votes
2answers
41 views

I am getting different results when using 'Maximize on play '?

so i'll be straight to point. when i move my character without using 'max on play' it works fine just as i wanted it to be. but when i switch to 'max on play' my character moves very fast. i am using <...
0
votes
0answers
20 views

Formula for displacement in a straight-line racing animation

I am making an animation of a race on a straight-line track (e.g. 100 m sprint, horse race, etc.). The results of the race are known in advance; all I need to do is animate the race. I am trying to ...
0
votes
0answers
18 views

Godot: Move_and_slide_with_snap not working on slopes

My Problem I am currently building a platformer game. I was attempting to use move_and_slide_with_snap for the first time and can't find it working for me. My character does snap to the ground like I ...
0
votes
0answers
25 views

Calculating radius during collision

This picture is from one of Dirk Gregorius' presentations: The original diagram has only one contact point (the red one). The r_1 and r_2 vectors are required to produce rotation while solving the ...
0
votes
2answers
41 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 ...
0
votes
0answers
20 views

Algorithm for simulating collision between circles of different mass

First of all, I'm not sure if this is the right site for this question, as it's actually a game I'm developing. However, I thought that this would be a common thing to need to know in games, so I put ...
0
votes
0answers
12 views

Contact points in collision

I am making a GJK-EPA based collision detection routine. In this picture, the algorithm picks up on two contact points (the endpoints of the green penetration vector). I'm certain that the penetration ...
0
votes
0answers
12 views

Spider physics to patrol on platform smoothly when changing direction

I have a 3 tile wide platform. I want my spider to hang from the ceiling and patrol this platform left and right. I have dx property for velocity. I want a physics code that shows how to achieve this. ...
0
votes
0answers
27 views

What are the parameters for a smooth wall jump

I want to make a platformer like Celeste and trying to implement wall jump. When the player is on the air and near a wall, and presses jump, the player gains x velocity opposite the wall direction, ...
0
votes
0answers
18 views

What is the correct formula for penalty forces?

I am trying to add penalty forces between two hard body objects, so when they collide they move in a realistic way. What I have so far is this: ...
0
votes
0answers
8 views

Help with Ragdoll snapping back to origin

So I have a ragdoll system that is enabled when the player is hit by an enemy. When the ragdoll is enabled I disable the animator, wait 3 sec, then enable the animator and play a get up animation. ...
0
votes
1answer
32 views

How do I manually accelerate the rotation of a sphere in Unity 3D?

I'm a little new to this so any help will be appreciated. Context: I'm creating a VR billiard/pool game and trying to get the physics as realistic as possible. I have a cue ball being hit with a cue ...
2
votes
1answer
44 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
18 views

How does skin width work in Unity's CharacterController?

I'm trying to write my own character controller and I want to understand how Unity's works. I think what it does is this: at each fixed update it takes the smaller collider reduced by the skin width, ...
0
votes
0answers
22 views

Calculate the starting position of a turning aircraft with inertial force to make it stop at desired position and heading

Continued from the answer here, I have some problem when the aircraft in my game has inertial forces after going forward and turning itself. To illustrate, from the following image (https://imgur.com/...
0
votes
0answers
12 views

Phaser 3 - How to make 2 object merging after collision (Like Claw Machine)

I'm new in Phaser 3. I use Matter.js for physics. I want to create something like Claw Machine : I have a claw (top) and prize (bottom) The claw will take a prize from bottom When claw hit the prize, ...
2
votes
1answer
56 views

How do I manually change a sliding ball into a rolling ball in Unity 3D?

I'm a little new to this so any help will be appreciated. Context: I'm creating a simulated VR billiard game and trying to get the physics as realistic as possible. I have a cue ball being hit with a ...
0
votes
1answer
23 views

How to simulate destruction/damage of household objects?

I'm looking for a method to simulate various objects' damage and destruction. As far as I can see, Unreal Engine 4's Chaos can only simulate buildings, but I'm more interested in other type of objects....
1
vote
0answers
12 views

Getting “continuous collision detection”-like behaviour out of triggers

I have a particular scenario where I want to use a trigger to adjust the course of a fast-moving projectile, but am running into issues because Unity does not support continuous collision detection ...
5
votes
1answer
60 views

2D Platformer Multiple Body Collision Response

I've been stuck for the past few days on implementing multiple body collision response, and I can't seem to find any good resource to help me advance. Colliding between two objects is simple enough. ...
0
votes
1answer
34 views

RigidBody or Character Controller for Zero Gravity first person shooter

I am developing a single person, first-person shooter that takes place in space. I want to be able to simulate zero gravity. Should I use a Rigid-Body or a Character Controller?
0
votes
1answer
24 views

Collisions and Colliders

Does anyone know how to prevent a gameobject from colliding with another gameobject but can still register collisions? Like a ball that can bounce off of the wall or ground and can pass through the ...
0
votes
0answers
22 views

Unity Ragdoll moves away from parent

So this is a weird one. I've looked it up but can't find anyone with similar issues. Basically I have a simple combat system and after the enemy health is zero I go through each rigidbody component in ...
0
votes
0answers
12 views

How to Cease the Ragdoll Wiggle Dance

When I instantiate a ragdoll object, it collapses nicely, but the movement never stops. It wiggles continuously. I'm using CharacterJoint components. None of the colliders (box and capsule) intersect. ...
2
votes
0answers
38 views

How to achieve variable jump height in an elegant and natural way

I am making a platformer, with a methodical approach to player physics. This is how I do variable jump height: ...
0
votes
1answer
31 views

Formula Racing Physics in curves (under-steer, over-steer)

I have a working physics code for a -let's say- WipeOut-style vehicle [well, closest approximation]. Some time next year I would like to do a formula game but am struggling to get to tweak my code to ...
0
votes
0answers
84 views

Roguelike movement system

I'm trying to implement a roguelike movement system for my game. I'm using the ECS architecture. The requirements are: entities will have a mass, on which should slow down the entity movement ...
0
votes
1answer
26 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 ...
0
votes
1answer
60 views

My bullets won't bounce in Unity?

I wanted bullets to bounce when they hit walls. However when colliding with a wall, they just jitter about on them. I didn't want to create a new physics material as I want to keep the ball moving at ...
2
votes
1answer
210 views

Linear interpolation: reach moving destination regardless its speed

I'm implementing a camera for a game and I'm using the LERP formula for smooth chasing. However, if the target moves fast enough, the camera can never reach it unless the ...
0
votes
0answers
15 views

Trying to create a knockback effect between 2 squares (Code in Java)

I've been in trouble for weeks now and I don't understand why it doesn't work for me! I have tried so many things and I just can not understand. I try to get one player to get a knockback as soon as ...
0
votes
2answers
32 views

How to calculate a movement Vector3 to kill unnecessary momentum and start moving in the right direction?

Imagine a rocket is accelerating in a straight line toward PointA, picking up momentum every frame, then suddenly decides it wants to go toward PointB instead. It can't just turn straight toward ...
1
vote
0answers
47 views

Simple collision resolution in a platformer game

I want to make a 2d platformer with moving, jumping and wall sliding. How can I make a simple pleasant collision resolution system that works for the following rectangles. Player is red, platform is ...
0
votes
2answers
55 views

How to rotate an object based on the movement and angles of Lifters

I have Lifters that "carry" an object. I want the object to move and rotate based on how those Lifters move. Requirements include: Supporting 1-4 Lifters at any side of the Object (e.g., ...
0
votes
1answer
46 views

Understanding Physics Materials

I have been reading the documentation about Physics materials, and it really seems very incomplete to me. When I try to work with it, I get so many questions... Maybe can someone help me wrap my head ...
0
votes
1answer
40 views

Having multiple different friction values on a single piece of track?

I am trying to figure out a good/performant way to give a piece of track multiple values of dynamic friction. A track piece is 10x10 units in Unity and the idea is to puzzle them together to a big ...
1
vote
1answer
54 views

Why is my player spinning after a collision?

I've made a very simple 2D top down prototype with Unity. This is the code I use for the player: ...
3
votes
2answers
280 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 ...
2
votes
1answer
50 views

Making pickup objects with gravity that won't push the player on collision

I am trying to create pickups, that appear after an enemy dies, and that the player can pick up, but I am running into some issues. First of all, I want the pickups to be affected by gravity, so I ...
0
votes
0answers
173 views

Apply external effects to player movement

In a 2D downhill game with the following, custom movement code, how do I apply external effects to the player's movement? For example, when the player hits an obstacle, I want them to get bounced off ...
1
vote
1answer
65 views

OnTriggerEnter not working when placed inside Update()

I'm making a scanner that scans the "world" (like a 10 x 10 space), and I'm trying to sense a GameObject called pointer. They both have colliders, they ...
0
votes
1answer
77 views

What are some of the tricks engine can use to render object that have extremely high polygons efficiently? [closed]

What are some of the tricks engine can use to render object that have extremely high polygons efficiently? I know one thing we do is render only the parts that the camera points at, but I am wondering ...
2
votes
1answer
75 views

A ball hits the corner slightly, where will it deflect?

I am currently making an iOS Game but I have a small problem. The game is simply a ball which you can control to avoid obstacles and find the food. When the ball hits, e.g. the top or the bottom of an ...
-1
votes
1answer
70 views

My character is not switching right or left like subway surfer in 2D?

I am making a 2D subway surfer type of game right now and I found this code on the internet that switches the lane of the player but the problem is it doesn't switch. When I play the scene it won't ...
0
votes
1answer
65 views

Bouncing ball loses its forward momentum after the first bounce

I've created a bouncing ball in Unity, and I want to bounce the ball across the field, but the results I get seem very unrealistic. The ball should bounce in the direction it was launched 2 or 3 more ...

1
2 3 4 5
41