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
0 answers
26 views

How to move an enemy to sneak up on the player from behind, using forces?

I have this code to move the enemy: (for x, same for y) ...
user avatar
  • 217
0 votes
0 answers
20 views

Best approach to model slipstream?

I am looking for a way to model slipstream effect in videogames. The two use cases I want to look at are a simple racing game and the simulation of a peleton (a big group of road bike riders), both in ...
user avatar
  • 133
0 votes
0 answers
19 views

AI car in racing manager game [closed]

I wonder how to make a smooth racing in manager game. All car go smooth with perfect curve, no sliding, good overtake, break.
user avatar
-1 votes
1 answer
24 views

The vector aiming to enemy is in wrong direction

In a 2d game, I am trying to shoot at a moving enemy and the vehicle that is shooting is also moving. However, the velocity of the bullet is not in the same direction as the position of the enemy. The ...
user avatar
0 votes
2 answers
56 views

How to connect rockets to a space capsule?

I am trying to create a space capsule that has four rockets to balance the capsule. The rockets and capsule haveRigidbody2D and ...
user avatar
  • 3
0 votes
0 answers
9 views

aiming prediction in 2d game using projectile [duplicate]

I am trying to make an agent predict the velocity required to throw a ball at a target and take into consideration the target. So what I need is a ball following a projectile path until it hit the ...
user avatar
1 vote
0 answers
56 views

Aircraft simulation

Trying to get a "semi" realistic aircraft simulator. I'm pulling my hair out because I just can't get the math right. I'm not looking for super realistic but want to at least get some ...
user avatar
  • 111
0 votes
0 answers
18 views

I have a "Floating Capsule Collider" setup, but if Collider stands on the edge of a platform, the player Mesh ends up looking 'stuck'

I have a "Floating Capsule Collider" setup, but it has an issue when the Collider stands on the very edge of a platform-- the player Mesh ends up looking 'stuck' inside of the platform. How ...
user avatar
  • 45
0 votes
1 answer
17 views

How would I calculate the velocity of a sphere with an impulse applied at the top?

I'm developing a rigid body physics engine and currently have accurately calculated the angular velocity of the sphere when impulsed. Unfortunately though, I'm not calculating the velocity correctly ...
user avatar
  • 1
0 votes
0 answers
62 views

Plot rigidbody path simulating magnus effect

I am trying to create a method that will plot the path a rigidbody will take when simulating a magnus type effect with no gravity in Unity. I realize this approach is a drastic simplification to the ...
user avatar
1 vote
1 answer
25 views

Configurable Joint rotation doesn't seem to respect mass difference

The Problem I've run into a physics issue in my Unity project, and have put together a simple example scene to illustrate it. Hopefully someone will be able to tell me if I'm doing something wrong. In ...
user avatar
3 votes
1 answer
95 views

Unity CharacterController steps on colliders with 0 Step Offset

I'm moving my CharacterController with the Move() method and for some reason it still steps on colliders even though its Step ...
user avatar
  • 626
0 votes
3 answers
55 views

How to prevent a huge backlog of physics calculations from freezing browser when tabbing out of browser game?

I'm developing a browser game and am using the timestep implementation from the famous Fix your timestep! article. It works perfectly, but there is one problem. If you tab out of the tab and then come ...
user avatar
0 votes
0 answers
14 views

Unity - Rigid Body Floats Away When Adding Ragdoll

I added a ragdoll component to my enemy model and now it just floats away whenever I run the game, this never happened before I added the ragdoll. if theres anything else I need to send just tell me ...
user avatar
0 votes
0 answers
27 views

Wobble physics like Sandwich Runner Unity3d

Here's the game, that's the wobble! I am trying to make a hypercasual game similar to Sandwich Runner, I can't quite figure out how the wobble mechanics was made! Where the stacked objects wobble when ...
user avatar
  • 1
0 votes
2 answers
93 views

How to manually Simulate Physics properly on Unity?

I'm trying to simulate physics manualy in a Unity 3D game. I've turned off Physics "Auto Simulation" in Project Settings and wrote this piece of code (it is more or less the unity doc sample)...
user avatar
  • 123
1 vote
1 answer
117 views

How to slide along a wall at full speed?

I was reading this answer, and while it works for that use-case, mine is slightly different (simpler?), but I can't figure out how to do it. What I'm looking for is a way for the player to retain ...
user avatar
-1 votes
1 answer
26 views

How to destroy just the specific powerup I hit, not all of them?

Creating a game for a computer science class - basically I have a player (cop) who will collide with donuts. When the player collides with a Donut, I want the speed to increase by 0.5 each time. Here ...
user avatar
0 votes
0 answers
31 views

How can I simulate something heavy?

I need to convey the feeling that something is heavy in a game-like experience. The environment is web-based, most likely mobile. Specifically, I need the user to be able to lift/move a chain and get ...
user avatar
  • 101
2 votes
0 answers
41 views

How to accelerate car based off of Animation Curve?

I am making a karting game and I want the karts velocity to accelerate based off a curve. This would allow me to quickly iterate different types of cars that accelerate in different ways. I was ...
user avatar
0 votes
1 answer
32 views

How to make a capsule Rigidbody player "kick" a Rigidbody sphere (ball) in Unity?

I am just learning the basics of physics simulation with rigidbodies. I am trying to simulate some basic real world functions like kicking a ball. Let's say I have a simple capsule mesh/collider as my ...
user avatar
  • 197
1 vote
0 answers
49 views

Circle and circle collision (with physics), but when lots of circles pile up things go wrong [closed]

I'm trying to make an as realistic as possible ball physics simulator. Currently, I worked out all the collisions between balls, and it works really well when there are few balls. But once you create ...
user avatar
0 votes
1 answer
53 views

Why do colliders have a tendency to spin and develop crazy angular velocity in Unity when used as my "player"?

I am trying to create a basic collider for a rigidbody player in Unity 3D. I have been experimenting with numerous shapes but found it hard to get what I want. The primary issue seems to be if the ...
user avatar
  • 197
1 vote
1 answer
12 views

What can I set in rigid body and collidable objects to ensure that the angle after collision is larger?

I have a rigid body with sphere shape attached and a static collidable box. When sphere hits the box at an angle, for some reason, the angle that it bounces off from is really small: https://imgpile....
user avatar
  • 189
0 votes
2 answers
72 views

In physics engines, what are the differences between moving an object with transform.translate and using RigidBody related functions like AddTorque?

I'm trying to recreate the ball maze puzzle game from Breath of the Wild with Unity. This is what I currently managed to make: As you can see, it's not nearly as smooth and I feel like I lack the ...
user avatar
2 votes
1 answer
70 views

Why are some gameplay systems set up to `exist in the world`, with full collision and kinematics, whereas others seem like `complex event timelines`

I wanted to ask a question I've always wondered about to the larger crowd of gamedevs out there: Why is there often a disconnect between the locomotion / kinematic systems that a player controls vs. ...
user avatar
1 vote
1 answer
38 views

How do I apply real time physics to a 2D game in Java?

I'm developing a 2D Brick Breaker style game in Java and want to apply some real time physics to it, especially to the paddle/ball interections. Nothing too complex; just applying some of the physics ...
user avatar
  • 13
0 votes
0 answers
31 views

Unreal Engine How would I make a one way physics door, that takes both walking into it, and mouse move it

Horror game. In the bathroom stalls I want the doors that opens 45 degrees you can walk into to open it or slowly use the mouse to open it while standing still and "lock" it, once inside ...
user avatar
0 votes
1 answer
72 views

How to find the maximum distance a target point can be hit from a launched projectile

I'm determining a trajectory necessary to hit target B with a projectile launched from point A with a given velocity. No problems there. Obviously, not all points B can be hit with a fixed velocity, ...
user avatar
  • 591
2 votes
1 answer
31 views

How to deal with rapid acceleration/deceleration from physics forces?

I'm working on a game in LOVE2D using Lua, where you pilot a drilling vehicle. The idea is that as you drill into different surfaces, you speed up/slow down depending on how dense that surface is. I'...
user avatar
  • 41
1 vote
0 answers
52 views

Move physics capsule at same acceleration regardless of surface slope

Into: I'm trying to move a capsule up/down a slope accelerating at the same rate as a capsule on a flat surface. I cannot set the velocity directly, because there will be many more forces affecting ...
user avatar
  • 121
0 votes
0 answers
87 views

How to do per-pixel destruction in Unity?

I want to make a game like Liero or Worms but with physics. I have no Knowledge of code, and I searched all over the Internet and all I found were either 3D Voxel Destruction, or 2D Tile map ...
user avatar
0 votes
0 answers
29 views

Source Engine - Strange factors in acceleration equation

I was going through the player movement code for the source engine when I stumbled upon the following function: ...
user avatar
  • 1
1 vote
0 answers
31 views

How do I simulate the forces acting on this hydraulic system?

I've been trying to create an algorithm to simulate a specific hydraulic suspension system for animating a car rig. Below are the schematics for the hydraulic system: All same-color lines are ...
user avatar
3 votes
0 answers
47 views

How do you compute for angular spring physics for physics joints in game engines?

I'm working on fixing Godot's physics joints. Currently, it uses Euler angles and it doesn't help me in building active ragdolls for my game. I heard that using quaternions is the way to go. So I ...
user avatar
0 votes
0 answers
31 views

Why does this AddForce code cause my character to zoom very fast in the direction it was heading, rather than just zoom downward?

I have code that takes movement from Player's keyboard input and applies AddForce based on it. Recently I added a GroundCheck function that is supposed to do: "...
user avatar
  • 45
0 votes
1 answer
26 views

Torque orientation when changing the coordinate system

I have some Unity application, where the user can input a torque that will be apply to a given rigidbody. Nonetheless, the sophistication comes from the fact that the input from the user is in a given ...
user avatar
  • 103
0 votes
1 answer
58 views

Why does my code intended to stop Rigidbody from sliding prevent player from jumping?

I have the following code which gives a Rigidbody capsule the ability to move and jump (if on layer Ground). After Player stops input, the Rigidbody slides. I ...
user avatar
  • 11
0 votes
0 answers
35 views

Sphere collision resolution when colliding with multiple meshes

I'm writing my own player collision physics and I'm stuck at collision resolution part. I have sphere as a player and scene made of static meshes. Collision resolution works fine when player is ...
user avatar
1 vote
1 answer
63 views

How to make a code-generated mesh interact with a rigidbody?

I'm using a sphere and an empty game object that generates a mesh upon playing/starting. On the mesh, I place a Mesh Collider component with ...
user avatar
0 votes
1 answer
29 views

Implementing Linear Diagonal Movement Relative to Camera Rotation

So far I've implemented horizontal (X-axis) and vertical (Z-axis) linear movement for the player in a 3D game. Using the code shown below, the player is able to move relative to the camera's Y-axis ...
user avatar
  • 101
0 votes
1 answer
40 views

How do you make Cube not instantly rotate upon Keypress in opposite direction?

I have this movement script on a Rigidbody cube with X,Y,Z Rotation Constraints. It is working well to move and to rotate in the direction of the movement. However, ...
user avatar
  • 11
0 votes
0 answers
40 views

What causes Rigidbody character to suddenly move at fast speeds?

I'm trying to make a Rigidbody-based movement script for a character. It behaves pretty much as expected, but every once in a while the character will suddenly run at a massive speed. I can't find a ...
user avatar
  • 45
1 vote
1 answer
59 views

How do I get the consistent time it would take for two points to reach each other in circular motion?

I'm making a 2D game. It involves the player swinging around a grapple hook in perfect circular motion, however, I want to make the cooldown for this ability based on predicted end position for the ...
user avatar
0 votes
1 answer
27 views

How to make trigger function respond to certain collider pairs and not others?

I assigned two colliders to one GameObject. Both are different sizes. I am doing operations with Trigger messages. I want this Trigger function to work for only colliders 1 and 3, but not collider 2.
user avatar
  • 13
0 votes
0 answers
111 views

Unity - Billiard balls unrealistic movement

So, I have this problem, even when I apply a small amount of force, the balls seem to get pushed away easily. Here's how they should behave (GIF from 8 ball pool game): And here's how I have it : ...
user avatar
0 votes
1 answer
46 views

Ball's spin speed seems to change erratically after AddForceAtPosition impulse

I'm trying to make a billiard game, and trying to add "spin" (aka English) functionality. The way I'm using to add spin is by using AddForceAtPosition(). Here's the code: ...
user avatar
0 votes
0 answers
70 views

How to implement crowd movement in Unity without rigidbodies?

I am working on a mobile game where its core gameplay includes a bunch of objects (can exceed 100) walking around autonomously in an environment where they push each other and get pushed by other ...
user avatar
0 votes
0 answers
32 views

High rigidbody drag value gives weird speed readings

when calculating speed in unity ...
user avatar
  • 35
1 vote
1 answer
24 views

How to snap a point to the height of the navmesh surface?

I'm making generator for EQS and need to put points on navmeshes located on different heights, one above other. So, my idea is to make raycast vertically and find intersection points with navmeshes. ...
user avatar
  • 231

1
2 3 4 5
45