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
1
vote
0answers
24 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
37 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
27 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
41 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
33 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
46 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
29 views

What is involved updating the graphics of X-Wing vs TIE Fighter game? [closed]

One of my favourite computer games is X-Wing vs TIE Fighter (1998). It's a Star Wars flight simulation- space vehicles blowing each other up: For such a great gameplay it's a shame the graphics have ...
0
votes
0answers
20 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
20 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
20 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 ...
-2
votes
0answers
43 views

Button Mashing Project Unity C#

As the title states I'm trying to create a button mashing script for a simple button mashing game where the player mashes any button on their keyboard to punch a ragdoll infront of them. I want every ...
0
votes
0answers
29 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
16 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 ...
0
votes
0answers
33 views

My Gravity is inverted halfway up my screen [closed]

I am using Unity2D to try and create a game one of my problems is I can't jump and I think I have found out why. Halfway up the game screen the gravity suddenly becomes inverted and I don't know what ...
2
votes
2answers
86 views

Should I scale gravity for small objects?

If I am working with objects that are small in real life, but in the Unity world they are scaled larger, should I increase the Gravity with the scale of the objects? For example, if an object of size ...
0
votes
1answer
33 views

Friction using delta time returns inconsistent result

Slowing down a character using the following formula returns different results depending on the frame rate: ...
-1
votes
2answers
51 views

How to make a sphere bounce while it is moving forwards Unity

I am trying to make a sphere that I have moving forwards also bounce at the same time. Here is what I have tried. Adding a physic material to the sphere and setting the material with a friction ...
0
votes
0answers
8 views

Physics Collision Resolving with Estimated Rotation

So I have a Sphere that I want to simulate simple estimated physics on it. I substepping with trace to find collisions, once I have the collision I can query Collision Location and Tangent - based on ...
0
votes
0answers
37 views

Seek a point with a final velocity

I've read a little bit about steering behaviours and I want to implement something similar to seeking, except that I would like my object to arrive at the target at its maximum speed in a specific ...
3
votes
1answer
176 views

How do I apply angular velocity vector after a collision?

I'm writing a small 3D physics engine, and I am trying to get the angular velocity vector of two shapes, specifically two cubes. For deeper understanding I have divide the motion to linear and ...
2
votes
2answers
144 views

FPS Character Controller movement - Any value in reverse engineering movement formulas?

From what I know character movement in popular FPS games tend to be non-linear, but the easing curves change between games as each has its own signature formula. Typically I imagine the physics ...
0
votes
1answer
40 views

Physics.CheckSPhere is not working

I try to use Physics.CheckSphere to check if a coordonate is empty. I use three for loop to cycle threw a 2 x Y x 2 chunk. The problem is that it return true if the corner is touching the coordonate ...
0
votes
1answer
32 views

Detect collision point [duplicate]

I'm writing a 3D rigid body physics engine, I am using OpenGl for simulation. Only convex objects are considered. My question involves how to detect the point of ...
0
votes
1answer
24 views

Gameobject stops moving or gets stuck when colliding with another GameObject

I'm currently making a brick breaker style game. My issue comes when the ball is launched off the pad it gets stuck in between two blocks. I have all the blocks on a "Foreground" layer with an "Order ...
0
votes
0answers
28 views

Client side prediction in 2D rigid-body physics

I'm currently working on 2D rigid-body physics multiplayer game using Matter.js for physics (both the client and server side) and Phaser3 for rendering. Both the server and the client run the ...
3
votes
2answers
61 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
1answer
69 views

can't make my unity character move

so I'm starting with Unity , I followed the john lemon tutorial , and I wanted to apply what I learn on a model on my own coming from blender. Everythings works , animation , rotation , but not ...
0
votes
0answers
65 views

something very strange in one of the collisions with OpenGL 3.3

As some of you know, I'm developing a game engine in C, and I came across a problem that left me kind of lost. When I was developing my collision system, I saw something very strange in one of the ...
1
vote
1answer
61 views

How to implement a slight skid in a car game

I have a top down car game, where I'm trying to allow a slight skid; I've tried the following code to calculate the X and Y, but there is no skid whatsoever: ...
1
vote
1answer
42 views

Using Minimum Translation Vector in SAT algorithm

I am working on a simple rigid-body physics engine ,I've already implemented SAT algorithm for collision detection and everything works fine, Now i get to step to use MTV to calculate the distance ...
0
votes
1answer
52 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 ...
1
vote
1answer
67 views

Minimal, unrealistic physics engine

I'd like to prototype a game with custom, very simple physics. Something similar to older games, anything from Super Mario to Quake 3 Arena. I'd prefer to avoid realistic physics engine because they ...
0
votes
1answer
18 views

Rigidbody2D moves on x axis without adding force

I'm currently trying to learn some Physics2D in Unity. Now, I've created a Ball (sprite) and added a RigidBody2D and a CircleCollider2D on it. The RigidBody2D has the following settings: Bodytype: ...
0
votes
1answer
75 views

help with shooting projectile along a curve path

so i been trying to find a way to shoot projectiles along a curve path . and i found this tutorial on youtube which was really good. i also uploaded the project in case you wanted to check it out. ...
0
votes
0answers
41 views

Objects are stumbling in place continuously. How to fix that?

I have a nasty problem with my physics engine. Objects sometimes just jump in place, or roll left and right. Main game loop works in that manner: Every living object is updated (it changes velocity, ...
0
votes
2answers
109 views
0
votes
0answers
38 views

Feathers and wind simulation in Unity

I would like to create a bird simulation that will use its wings to interact with the surrounding air. How can I achieve this?
1
vote
1answer
32 views

ContactFilter2D does not detect a trigger even with “use triggers” enabled

I'm Using Unity 2018.3.11f1 and I'm going crazy trying to understand why the "use triggers" variable of the ContactFilter2D is not having any effect and I'm always detecting only the non-trigger ...
0
votes
0answers
13 views

Collision Checking in Unity immediately after instantiation

I'm working on a dungeon generation script and I'm having some issues detecting overlap. Each piece that I spawn has attachment points, with rotation values and an offset amount so things lineup ...
2
votes
1answer
34 views

How do I calculate vehicle rotation when two car wheels are on the ground to simulate gravity?

I'm writing some code to simulate a vehicle (tank or car) driving over a heightmap terrain. I'm not using a full physics engine, and just simply checking the height of the terrain at the 4 bottom ...
1
vote
1answer
46 views

Character moving without control

i've been developing a third person adventure game on Unity with a grappling hook and i found a problem that i don't understand and it's driving me mad. Basically, if the player character collides ...
3
votes
1answer
126 views

Predicted trajectory becomes less accurate in a side-on collision

In my 2D billiards game, I have it so that when the user clicks and drags with their mouse, a Physics2D.CircleCast is projected from the cueball to wherever the mouse is. If the circle happens to hit ...
0
votes
1answer
33 views

How can I avoid the precision loss when recentering objects on open terrain?

For a better context this question is related to this one: What's the largest "relative" level I can make using float? When the player is moving too far away from the center, all the ...
0
votes
1answer
82 views

How to detect when the player has filled a shape?

In my game, the player is presented with a plane containing obstacles (orange / blue) and regions of empty space (white). The player moves their green cube around the empty space, which instantiates ...
0
votes
1answer
46 views

2D character tips over sideways after collision with platform

This is what happens when my player character jumps and collides with a platform from the side. The player character tilts over or ends up upside-down or sometimes on its back. How can I prevent this?...
-1
votes
1answer
50 views

Wind in video game project [closed]

How to make the wind blow with randomized patterns? Like for storms and calm breezes?
2
votes
1answer
74 views

Math needed to create a very simple 2D side view car game

I'm trying to create a 2D side view car game (something like Hill Climb Racing, but much more simpler), but I'm confused on the math and physics. Most of the tutorials I found were about making a top-...
0
votes
0answers
12 views

Unity rigidbody glitch throu corners [duplicate]

No matter how thick the wall is, the player will glitch through. I've tried changing the settings on the rigidbody but nothing have worked. The walls fits together almost perfectly. Why is this ...
0
votes
2answers
51 views

Javascript Jumping Physics

I have asked questions for this project before, but the jumping physics are a bit messed up. I cannot jump unless I hold down the W key, and then it just teleports me upwards. Does anybody know how to ...
1
vote
1answer
55 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 ...