Tag Info

New answers tagged

1

I would check your scale. Physics in Unity are designed to work at real life scales (1 unit = 1 meter) If you create a scene that is not to the correct scale, you are going to have a terrible time getting it to look correct. Example: Lets assume your ball is supposed to be a basketball. A standard basketball is 23cm (0.23m) If you build everything to ...


0

Anko was right with his comment. Physics.gravity is a static vector 3 variable that you can change in your code. http://docs.unity3d.com/ScriptReference/Physics-gravity.html You can modify gravity along with things like friction and drag to give desirable results.


1

You then have the centers of the BB without having to know the size of it, if your game needs to know the centers more often than the top left then that is preferable. Storing the half vectors is to simplify retrieving the left/right and bottom/top vectors center-halfHeight provides the bottom and center+halfHeight provides the top. Granted all it does is ...


1

The problem was caused by the friction configuration on the character's physic material. Changing it as the image shows fixed the problem: It seems that over .001 of dynamic friction and .01 of static are enough to start slowing the fall of the character when hitting a wall.


3

I did the following to achieve results: Added a Rigidbody2D to the player (deactivate Gravity). Added a 2D-Collider to the bomb. Added control and health script (basic stuff, just position updates). My health is just a public variable. Used the following code in playerPhysics.cs: void OnCollisionEnter2D(Collision2D coll) { if (coll.gameObject.name == ...


1

The formula for reflecting an incoming vector v across a unit normal n into an outgoing vector v' is v' = v - 2*dot(v,n)*n You can determine the normal n from normalizing the difference of the collision point and the center of the circle. See the question on How to get a reflection vector? over on Math.SX for more elaborate derivations.


0

Most of the mecanim setup stuff is irrelevant; this question mostly rests on what IsGrounded() is doing. Whatever is happening in there to detect the ground is not working correctly, and it considers hitting the wall to be "on the ground".


4

This is a pretty advanced topic. Generally people like to use Boolean Set Operations implemented with a BSP tree for this kind of destruction, which revolves around splitting polygons over planes. Take a look at this paper by Naylor to learn how. This will let you overlay one mesh upon another and perform a subtraction. The results of the subtraction can ...


0

You dont need complex math for this simple thing. To get the slide collision response do this: move along x axis, if collision=true adjust x position (stop the x movement). Pick this new positon add y movement and test collision. If true adjust y position. Pick this new position and add the z movement adjust z movement in case of collision. The key to slide ...


2

Well, you do need a basic understanding of physics, but I mean like what they teach in physics class in highschool. Assuming you went to highschool, then no there isn't any additional knowledge of physics that you need as a prerequisite. That said, you're going to be learning a number of new concepts and/or applying concepts in ways that are new, because ...


2

The problem is objects movement in digital world is discrete. In real world, it seems natural if a bar extends, it does is over time - computers cannot "move" objects, so they simulate this behaviour by setting their position by small steps dS. However, if the movement of an object is too fast, it can produce weird resulst like shown on video - bars actually ...


1

The problem is that bodies only ever move towards stable orbits in 3D. In 2D they will not tent to move towards stable orbits using "realistic" physics. If you do want to get a stable orbit you will need to mess with the formula's that dictate speed. Completely forgoing Newton's laws in favour of a system with completely different exponents. For more ...


2

This is a classical control problem. You want to create a feedback loop that takes the divergence from optimal position and applies the appropriate torque to nudge it back into position. btQuaternion targetOrientation = // whatever you need btQuaternion currentOrientation = myObject->getOrientation(); Getting the delta orientation is quite simple, ...


1

I approached with a little Googlesearch ;) From what I found bt:RigidBody::applyTorque(btVector3 & torque) takes a vector in WorldSpace and uses it as axis to apply a torque which has a strength of the length of the vector. The LocalSpace-Torque seems to be solved in this answer, even though the provided code looks like there has to be an easier ...


2

Say the object is 10 meters above ground. Assume that our dt (delta t) is 1 second. The object goes to the height of 9 meters at the end of the first iteration Here lies your problem. It is true that the velocity at the end of the first iteration is 1 m.s¯¹. However during that time the object has not travelled 1 m. In fact, since the acceleration is ...


1

If having your overall collision surface look something like this is acceptable, then yes, use a couplefew sphere colliders parented together somehow, since spheres are cheap (in fact I think the reason they're cheap in physics is because they're restricted to distance checks from a point, which is why you can't transform them): Otherwise I would suggest ...


1

What you seem to have is a double pendulum which is inverted. Here, m2 is the player's center of mass. In order to remain in balance, L2 cannot be tangent to the ball (they would slip off) and m2 must remain nearly above f (otherwise they'd fall over). Obviously this would be complicated to manage in a game where you can't feel how you're balancing. A ...


0

SpriteKit uses SKAction objects to accomplish most of its functionality. What you're seeking is SKAction's followPath:duration: action. The following accomplishes this: UIBezierPath *path = [UIBezierPath bezierPath]; [path moveToPoint:CGPointZero]; [path addQuadCurveToPoint:CGPointMake(deltaX/2, desiredHeight) controlPoint:CGPointMake(0, ...


3

In most game engines, physics objects live in their own world, and are connected to game objects through some special logic, responsible, for instance, for copying transformations and notifying about events like collisions. Your case sounds like it requires multiple physics worlds. Most physics engines will allow you to do that, as they are designed in a ...



Top 50 recent answers are included