New answers tagged

0

Fixed by setting Linear Drag in RigidBody 2D at 1.1 (value depends on gravity, etc), which damped the fall speed and now the objects don't accelerate with time when falling. Rotation can also be damped by setting Angular Drag to the appropriate value.


0

It seems to me that what you're doing has the correct basic form. But I think rigidbody.inertiaTensorRotation needs to be taken into account, though I'm not 100% positive on this either. I would argue though, that it must be that rigidbody.inertiaTensor is diagonal with respect to some arbitrary coordinate frame, while rigidbody.angularVelocity is most ...


0

For this purpose I would use Verlet integration. It's nice and easy to implement algorithm. You can read more about it here.


1

This link looks interesting and provides almost that what I need, maybe it can help somebody too http://forum.unity3d.com/threads/animfollow-active-ragdoll-is-now-free-to-download.220812/


2

When you are dealing with AddForce and AddTorque, you are simulating physics. You are utilizing the RigidBody component of your physics engine. Do you require a physics engine for your game? Or do you want to fake the physics yourself? You cannot apply forces to a transform. You also don't need to have a RigidBody component on your gameobject in order ...


1

Adding force means you are simulating some degree of pysical movement. Do not play with vector(force) if you do not need to simulate physical property in your game.


1

As you probably already know based on how you formulate your question, the physics engine only registers collisions whn at least one of the colliders have a rigidbody attached. In many cases you can just add a kinematic rigidbody that is not affected by gravity to get a collision detection going. Unfortunately the Collision2D.ContactPoints, which is of type ...


0

Use physics joints in bones of cable/rope model. You will get better physical result. Use configurable joint for more control. We used same method to tank crawler and wheel. Using cloth physics seems not related in your case.


3

Your starting velocity is a vector, not a scalar (to be pedantic, V0 is actually the speed, i.e. the magnitude of the velocity). If v0x= v0*cos(a) and v0y= v0*sin(a), then your analytical solution for the positions is correct: sx(t) = v0*cos(a)*t and sy(t) = v0*sin(a)*t - g*t^2/2. Your question is ambiguous, but assuming you want to find the launch speed ...


0

In general rigidbody physics is appropriate to model non-living things, while a completely different system of bone and animation based physics is usually used on living things and things which behave like living things (like robots or zombies). For example, if you drop a stone on the side of a hill you can model what will happen using a very simple system, ...


0

I would do what the above posters suggested, Shadow and size increase when ball is higher. A thing I remember from playing tennis on old TV games is that the ball also slowed down the higher it went and bigger it became. When it reached it's zenith and started "coming down" it would start going faster again as it became smaller.


74

Shadow and texture. Texturize the ball to show it rotating. This helps give the illusion of rotation of a sphere, which is more than 2 dimensions. A shadow can trick your brain into believing all sorts of things. Making flat things look like they have a third dimension. You don't even have to change the height of the ball, you just need to change ...


1

Shadow and Ball are key aspects. Shadow size and distence between Ball and shadow should increase when height increase. Also, Ball size should increase when Ball height increase. Shadow position represents position of ball in 2d and when Ball height increase you have to change Ball position (I m assuming that light source is homogen and it is not single ...


75

Give the ball a height value. Draw a shadow at the ball's actual 2D position; the shadow will help spatially orient the ball for the player. When you draw the ball itself, offset the Y position by the "height" of the ball. If you want to implement more than just an illusion, use this height value in computations as well -- for example, you can implement the ...


-1

You draw a shadow below the ball, like it's done in the gif. The higher the ball, the longer the distance between the ball and the shadow.


-1

The way I solved this was to apply the torques during the pre-tick callback for bullet physics.


0

There's two things you can try: - Set it to Is Kinematic, so it will not move unless you explicit do it by code. - Set the collision object as IsTrigger, so it will not move if another object collide with it, and to maintain the object on the air, try this: float massObject = 1; // adjust for the crate mass, if needed Rigidbody rb; //to get the rigidbody ...


0

I'm not sure if I understood the problem right but maybe you can limit the Z rotation of the character to a certain angle so it can't tumble when you are going downhill. But if you also want your character to be able to flip in the air at certain heights for extra points or whatever your score system is, you can set the rotation limit only if the player is ...


1

When in doubt: Fake it. Instead of calculating the wheels from where the cart is, calculate the wheel direction from where the wheel was. Something like this: //Constants, per wheel. I'm assuming Y is up/down var wheelOffset = Vector3( -40, 0, -10 ); //Variables kept over multiple frames, per wheel var wheelAngle = 0; var lastWheelPosition = 0; //Per ...


1

In Alto's Adventure, the terrain is dynamically generated over time, by concatenating prefabricated patterns (for example the super steep slope where you can perform a triple backflip, or any other soft slopes) in a randomic way to keep the game various from play to play. A possible implementation can be treating these "pieces" of terrain as vertices, from ...


0

Get the Rigidbody component. Then change the velocity value. Rigidbody rb; void Start() { rb = GetComponent<Rigidbody>(); } void ChangeSpeed() { rb.velocity = new vector3(x,y,z); //place your value in xyz } For further reference: Unity Physics Rigidbody Velocity


1

Set the new Physics Material on the object you are colliding with. Make sure you set the friction to 0. http://docs.unity3d.com/Manual/class-PhysicMaterial.html


1

Create four GameObjects. Add a Collider to each GameObject. Set the physics material of each Collider. http://docs.unity3d.com/Manual/class-PhysicsMaterial2D.html Set the bounciness to the value you want in the Physics Material. Each GameObject would have it's own physics material with specific bounciness.


0

Your Box2D method sounds great, but that kind of stuff only works when you understand exactly how the engine works. You could You start with a strong push force, and then you use an opposite force, which you increase while you get closer to the desired place. But if you want to move an object to a specific position, I think that the best way is to do it ...


3

A rational approach might be to simplify your problem. This is a game, so most of the time there is no need for 100% accurate physics. Instead of tracking every single component that makes your ship, you can instead prepare several damaged ship models and swap then on the fly as it gets more and more damage. When you swap the models, you could spawn some ...


3

You need to do something like this. its simple public GameObject YourGameobject;//refrence of your gameobject void Update() { if (Input.GetKey(KeyCode.W))//on W input it will disable the gravit of your desire object { YourGameobject.GetComponent<Rigidbody>().useGravity = false; } } You can change ...


3

This is in no way a complete answer. What you could try is: for each finger touching the interface, you calculate the distance and direction of each particle from the touch point. With the distance, you compute a force (use x as input, and have y result in something based on a logarithm or square function: the closer to the well, the stronger the force). ...



Top 50 recent answers are included