Questions tagged [rigid-bodies]

Rigid body is a solid body which deformation is neglected. The mechanics of a rigid body are completely reducible to the mechanics of material points but it has its own content.

In a rigidBody is a component of a which allows the engine to calculate the behavior of the object and simulate a variety of physical interactions and collisions with other game objects.

Additional information:

Wikipedia article about Rigid Bodies

Unity RigidBody scripting reference

431 questions
3
votes
1 answer

Libgdx bullet offset origin

i am using blender to create my models, and loading them into Libgdx, if i create them with the Origin in the center of the model like below and then use this code to create the rigid body, all works fine Vector3 hescoWallHalfExtents = new…
Spriggsy
  • 196
  • 1
  • 18
3
votes
2 answers

RigidBody2D freeze X position

I'm wondering if there is a way to emulate the following line of code using Unity's RigidBody2D as opposed to using a normal RigidBody. rigidbody.constraints = RigidbodyConstraints.FreezePositionX; I wanting my players x position to freeze when it…
N0xus
  • 2,674
  • 12
  • 65
  • 126
2
votes
1 answer

Unity physics collision issue, I think I need a pseudo kinematic rigidbody of sorts?

I´ve got a pretty specific issue for which I´m not sure there is a fix. I want to have a rigidbody that behaves like a kinematic except when forces are added. Let me explain. My context is I´ve got a ship in zero gravity, then some objects within…
2
votes
0 answers

How to obtain centroidal momentum matrix explicitly for momentum-based control purpose

there are useful APIs to calc centroidal momentum, like CalcSpatialMomentumInWorldAboutPoint. But for momentum-based control, I ran into some problems with this API. During control there is: l = A(q) * v and I want to take this as a constraint to…
zisangsang
  • 81
  • 6
2
votes
2 answers

Disable RigidBody Gravity Temporarily C#

Firstly I want to apologise as i understand this will be a very basic request, but I am very new to this world. i just wish to disable the gravity element of my rigid body for a set amount of time and then enable it until the game resets. if I have…
2
votes
1 answer

Unity Button to roll 3D dice looking for Rigidbody on the button instead of the die object

I am new to Unity and have been experimenting with dice rolling. I came across a set of tutorials which allowed me to create a 3d die (the die uses Rigidbody and Mesh Collider) and script it to roll on the press of a spacebar as…
Sweepster
  • 1,829
  • 4
  • 27
  • 66
2
votes
2 answers

How can i make a rigid body jump in godot without givign it the ability to fly

I would have used a kinematic body but i want to add real life physics to my 2d object but it seems that i can literally fly by pressing the up key several times extends RigidBody2D var velocity = Vector2.ZERO const GRAVITY = 35 const SPEED =…
2
votes
1 answer

How to detect for collisions with instantiated prefabs

I am making a first person shooter using bullets and I'm trying to find a way to delete the instances when it hits an enemy or the wall but its not working. The way I've done it is to give all the walls and enemy's a tag for specific collision…
Zina
  • 159
  • 8
2
votes
1 answer

Stuck Implementing A Way To Rotate A Rigidbody Towards A Point With Rigidbody.AddTorque

So I am kinda stuck on what to do now because as I said I am trying to use Rigidbody.AddTorque to rotate a rigid body towards a certain point, which I was going to use to align a player with a gravitational pull so they can be upright. I have got…
Phoniez
  • 51
  • 7
2
votes
1 answer

How can I get smooth random movement (2D Unity)?

I'm using Random.onUnitSphere to simulate bubbles floating around jostling for position. It works well although the movement is too "jerky". I'd like to create the same effect but slow it down and make smoother random movements. Is there anyway I…
Evan
  • 77
  • 8
2
votes
1 answer

Unity: Set RigidBody velocity in FixedUpdate() or Start()?

I'm developing a simple 2D game in Unity (balls hitting bricks), so i have a ball and i want to fire the ball to hit bricks, now to fire the ball i have to set Velocity on the RigidBody component attached to the ball's GameObject. There are two ways…
Fadi Obaji
  • 1,454
  • 4
  • 27
  • 57
2
votes
1 answer

Have fixed speed with AddForce?

I want to use AddForce to move an object with a fixed speed but when I use AddForce the speed of the rigid body increases in crescendo. AddForce adds a force to me every time I hold the input down, the more I hold the key to move the object the more…
2
votes
2 answers

OnTriggerEnter2D and OnTriggerExit2D called mutiples time

I have one Player with RigidBody2D and a pillar with BoxCollider2D. I check when OnTriggerEnter2D is called ( Player collided with the pillar ) then I try to keep Player position by change his bodyType to Static. When OnTriggerExit2D is called,…
suntzu
  • 159
  • 9
2
votes
0 answers

Unity: AddExplosionForce only works sometimes

So I have a sphere for the player, and whenever the player is damaged by an object it should knock the ball into the opposite direction, so I am using AddExplosionForce to do the effect, but sometimes it knocks the player back and sometimes it…
Joshtapus
  • 21
  • 4
2
votes
1 answer

RigidbodyController background stutter (Am I moving my Rigidbody controller correctly?)

I'm working on a playercontroller, very basic and am encountering loads of stutter when using the rigidbody player. I also have a character controller player which runs very smooth, both tests are at high fps 600 ish (v-sync turned off). I am using…
Quincy Norbert
  • 431
  • 1
  • 6
  • 18
1 2
3
28 29