# Tagged Questions

Relating to the motion of objects through space (in 2 dimensions (x,y)) and time. Including concepts such as acceleration (thrust and gravity), mass, collision response, friction and more.

7 views

### How to move sprite mimicking mouse/touch position on some part of the screen?

I am having a difficulty and I am been doing it wrong, I think. I want to move sprite relatively to touch. Just like when you are playing space shooter like 1943. I just learning some math and try to ...
21 views

### Bouncing projectile off of sprite, the sides work but top and bottom do not

I'm having a problem bouncing a projectile off a sprite, we've been asked to move the projectile using the equations of motions which makes things a little more difficult but as far as I can see what ...
81 views

### How do I make circles bounce off each other realistically?

I'm trying to create bouncing balls with realistic physics. At the moment, when the balls hit each other, they bounce back in the same direction they came from. How do I make them more realistic? I ...
11 views

### Sizing a Box2D ground object

I am developing a platformer game using SDL2 for graphics and Box2D for physics. I am currently designing my levels and would like to know if it is better to make the static part of each level (ie: ...
14 views

### Need help in getting sequential impulse method working

i have made a very very simple physics system based on sequential impulse method - with single contacts only and no angular rotation at all. Contact points are calculated using separating axis ...
43 views

### How to prevent bullets from passing right through entities?

(sorry for bad english) I'm making 2D arcade game. I write all of physics stuff myself. The problem involves bullet behaviour. Imagine bullet flying towards some entity. If the bullet's velocity is ...
26 views

### LibGDX make an object rotate around something

I need to rotate and object, which should be a circle made up with a ShaderRender, around a specified point. In LibGDX there is a method or something which allow me to do this? If it doesn't exist how ...
20 views

### Libgdx bouncy effect in a wall

I have an element inside the screen and I want to set my phone's bounds as a wall where elements are bouncing. I want it to be physically correct. How to do this?
79 views

### Good collision resolving mechanism

In my game i have plenty of objects that can collide. Literally, most of them can collide with each other.The problem I'm facing is that i can't come up with some good collision resolving way. How can ...
66 views

### How do I calculate rotational impulses in rigid body collisions?

I'm writing a simple 2D physics engine to help me understand the inner workings of physics engines. I'm following Randy Gaul's tutorial which can be found here and It's been extremely useful and ...
41 views

### Calculating density of an object

I'm using Box2D for physics in my game, and one of the things it needs to know when creating a shape for a physics body is the shape's density. I had no idea what value I should specify, so I went to ...
67 views

### Sprite Kit - keeping character level with the terrain 2d endless runner

I've been trying to figure this out exhaustively for the past few days and still haven't found an answer. I have an endless runner built using swift where the character is fixed and the terrain moves ...
14 views

### how to trigger a ball from rotating cube in z axis

how to release ball from the cube which is rotating in z axis, ball should move in Y axis and ball should be reloaded after releasing the ball ?? Thanks in advance cheers Gokul
338 views

### How is RTS Local Avoidance Done?

Currently, I'm simulating physics impact forces for local avoidance of units but this method sometimes pushes units out of formation and has very undesirable effects when units clump up. For RTS ...
33 views

### b2DistanceJoint with frequency equal to 0 vs b2WeldJoint

What is the difference of b2WeldJoint and b2DistanceJoint? They both have frequency and also when you put frequency of Distance Joint to 0 it acts like Weld Joint. It seams that you can create ...
201 views

### Why does my character stop a little before landing on the ground?

I made a little game with side-scrolling and a box (the player) jumping across the level. The simple physics are almost done, but I have two problem with the way things behave: On landing, the box ...
56 views

### In Box2D, how do I create an infinitely oscillating spring?

How do I create an ideal spring that can oscillate indefinitely using Box2D? A b2DistanceJoint works almost perfectly, but it eventually slows to a stop, even with damping set to 0. I think it is ...
39 views

### Unity 2D Current object force

I'm working on a game with an entity firing a shot. This shot could destroy other entities as well as the entity who generated the shot. My first step was to apply a force to the rigidbody2D of the ...
81 views

### Create a 2D orbit trajectory like in angry birds space and a circular orbit

I am working on a 2D game, and I am working on adding some space physics : I need to find a way to create a circular orbit and an orbit like angry birds space ( the spiral trajectory ) . So there is 2 ...
31 views

### wheeled 2D character controller platform edges problem

I have built a little wheeled 2D character controller (a rectangle for the body and a circle for the legs with a motor joint). Everything is ok but the problem is that when the player reaches the edge ...
122 views

### Moving one object from one point to another with acceleration

How would someone implement moving an object from one point in 2D space to another using these formulae to update objects: m_position.setX/Y( m_position.X/Y() + m_velocity.X/Y() * dt + 0.5 * m_acc * ...
86 views

### Why doesn't this 2d physics calculation yield the desired jump height?

I found a formula for gravity and jumping in this article: http://error454.com/2013/10/23/platformer-physics-101-and-the-3-fundamental-equations-of-platformers/ I implemented this formula and ...
43 views

### unity2D Top-Dow Mobile rigibody2D

im using this code for my 2D TopDown mobile player movement.but when i move player With UI Image buttons player keep moving.it didnt stop.and also player starting of move he is very slow. the he ...
62 views

### Rain World : How to have intelligent movement / animation?

In the project RainWorld the characters seem to move "intelligently" as they move "unrestricted". They seem to know "how" to move their limbs and "what" needs to be done. Here for an example the ...
66 views

### Spherical Collision

I have a made spherical collision system which creates a major problem, the balls gets stuck to each other on high speed and sometime with low speed collisions. I researched a lot but I couldn't found ...
15 views

### How can I track a leader vehicle at a specific angle and distance?

I am using Matlab and have code which allows a vehicle to find its way to certain coordinates chosen by the user. I now want to add a second vehicle which stays fixed at a specific distance and angle ...
97 views

### Physics2D.OverlapCircleAll seems to be bigger than my radius

Im trying to make a "Scorched earth"-like game using unity. I managed to fire my bullet and make it explode on contact. What I am trying to do is do some damage to the tanks even if the bullet didn't ...
66 views

### How do I make a time lapse in my code so it updates slower?

I have made some collision if statements, but they didn't work. birdbox3.X += 5; birdbox3.Y -= 5; if (birdbox3.Intersects(Banner1)) { birdbox3.Y ...
52 views

### Does unused 2D colliders in Unity affects performance? Is an Edge Collider more performance friendly than BoxCollider2D?

I am using a lot of gameobjects for my platformer that uses BoxCollider2D component to make the scene floor. But only an a selected set of gameobjects actually have some interaction with the player, ...
21 views

### Launching projectile from a “canon” [duplicate]

I'm working on "Scorched earth"-like game just for learning purpose. I can't figure out how to launch the projectile from my tank's position, with a power of X ([0,100]),at an angle of Y ([-180,180]). ...
51 views

### Using Box2D for soccer physics

I've learned quite a bit of Box2D and I've succeeded basic stuff concluding ball physics. I want to implement 'opposing forces', as the character kicks the ball with a certain strength, with the leg ...
173 views

### Cocos2dx+Chipmunk: Fully elastic collision between moving bodies

I'm using Cocos2dx and the built in Chipmunk physics engine, and currently I've got my PhysicsBodys' materials set up with: Density=0 Restitution=1 Friction=0 in order to get fully elastic ...
105 views

### Dynamic body in Box2D with fixed position

I need to fix the dynamic body position so that it would not rotate and would not move even if there are other forces, collisions and so on. Let me first explain why I need this. I have a dynamic ...
53 views

### Physics-based rotation with an array of pixels

Say I have a simple system, that has a large array of pixels with their own weight, velocity, coordinates etc. (by using classes) if each of those pixels can be connected to 4 other pixels (top, ...
36 views

### PhysicsJS object falls through the world

I have a problem while using PhysicsJS when it comes to collisions. I created a physics world, an object and applied gravity. I put the object at a certain position, it falls down because of the ...
58 views

### Relative movement in Box2D (keep object from falling off planet)

I'm creating a game with planets orbiting around a sun, like this: The brown square is the earth, rotating around its center and around the sun. The yellow square is the sun, which doesn't move. Now ...
13 views

### How to experiment for the value of gravity in Libgdx? [duplicate]

I am following a guide on how to play a flappy bird clone in the LibGdx framework. -http://www.kilobolt.com/day-5-the-flight-of-the-dead---adding-the-bird.html I am currently on the part where the ...
128 views

### How do I derive an appropriate acceleration value for my game?

I am creating a Flappy Bird clone from this tutorial. I have a question about acceleration in libgdx. The author assigned the bird a constant acceleration vector in the constructor of the bird ...
58 views

### Farseer: Friend/Foe Collision - cannot push foes but friends

we are using Farseer in our project and I try to find a setup to achieve the following quite complicated collision behavior: Friendly Units can push each other aside. However, the push should be a ...
272 views

### 2D Boat controlling physics

I'm working on a top-down 2D boat game with Unity3D. I couldn't able to understand how to implement physics of rudder controlling. My physics knowledge is not enough to think how rudder dynamics work. ...
72 views

### Lots of bouncing balls sink into each other [closed]

I'm trying to model a system that simulates an arbitrary number of bouncing balls with some gravity. So far I've come up with a solution that can be seen here: ...
169 views

### Unity2D Collision Issue

I have a crate setup (in pic below) with a rigid body component, box collider and 3 circle colliders(they allow me to push the crate most of the time without getting stuck on the floor textures which ...
106 views

### 2D bouncing formula doesn't work properly

am new to unity, and i am trying to create a bouncing ball, so i've did many researches about bouncing realted physics and i found a formula : Formula: -2*(V dot N)*N + V Where V is the velocity ...
47 views

### How to reposition a bouncing ball after it has passed through a surface

I have a bouncing ball which can collide with lines of a random slope. The ball passes through the lines a bit and I need to set the ball back some distance from the line. The ball (defined by ...
87 views

### Unity2D: Apply gravity to some items, when everything else is gravity-free?

Sorry for the incredibly vague title: Let's say you have an NPC, and when he dies he'll spawn items, coins for example. Instead of just pushing the coins in random directions it would look a lot ...
213 views

### How can I manage the deceleration of units so that they arrive on-target?

When I first started trying to set up my air units' movement in my RTS game, I thought it was going to be easy with simple Euler method linear acceleration. This was far from the case as the ship ...
653 views

### Unity rigidbody2d.velocity jumping causes weird bouncing

Im working on a game 2d game that has some platforming. I followed this video as guidance and produced the following code: public class PlayerControler : MonoBehaviour public float ...
127 views

### SpriteKit: Is applyImpulse not working correctly?

I am writing a free throwing system and because of this, I created a ball using following code. self.ball.position = CGPointMake(posX, posY) self.ball.fillColor = SKColor.blueColor() ...