Questions tagged [rigidbody]

In game development, a rigidbody is usually referred to anything that is affected by physics.

97 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
1 answer
441 views

How to get consistent collision impulse values for colliding rigid bodies in Godot?

I'm writing a game where you can pick and throw objects and depending on the force of the impact they break. Using the get_contact_impulse method to calculate the breaking point gives me very ...
Luke B.'s user avatar
  • 1,117
4 votes
0 answers
1k views

Unity & Alternatives to non-convex collider + non-kinematic rigidbody

I am working on a voxel game, where everything is one or more chunks of voxels (16x16x16). As voxels can be destroyed the chunk and collision area changes and can of course become non convex. So to ...
ElDuderino's user avatar
4 votes
1 answer
224 views

Set input relative to map rotation?

I'm trying to figure out how I can make the input which looks like this : ...
BiiX's user avatar
  • 489
3 votes
0 answers
345 views

Unity - kinematic rigidbody character calling OnCollisionEnter and OnCollsionExit on every frame for specific collisions

I'm encountering an issue with my character collider behavior. I have several elements that are relevant to this issue: a "character" gameobject (capsule mesh), that is assigned with a kinematic ...
user2828965's user avatar
3 votes
1 answer
3k views

Rigidbody slows down when its going up a slope. What can I do?

I am using unity and I am creating a 3d topdown game. There is no jump feature. The input handling supports only x and z axis player movement. Climbing slopes or falling from gaps is something I want ...
poloapolo's user avatar
3 votes
0 answers
586 views

Add Rigidbody and MeshCollider at runtime : is it a bad practice?

Good day. To simulate an explosion of a vheicle, I decided to do this: When I need to explode veichle , at runtime, i add rigidibody for every single part of veichle (5-10 part: door, wheel, hood ...
stighy's user avatar
  • 427
2 votes
0 answers
57 views

How to connect particles to rigid bodies in LiquidFun?

In vanilla Box2D various types of Joints can be used to connect two rigid bodies together. The LiquidFun extension brings the Particle Module, but I was unable to find a way to connect a particle/...
Simon Zvara's user avatar
2 votes
0 answers
1k views

How to Make a Ladder Climbing Script

I'm inexperienced and I'm trying to understand the mechanism for using a ladder with my character or climbing over small walls. To move I use a Rigidbody, not ...
Daniele Pappalardo's user avatar
1 vote
1 answer
64 views

How to settle a rigid body to rest on flat surface

I am trying to simulate the behaviour of a rigid body, for example a cube, while it settles on a flat surface. Let's say it lends on an edge or even on a corner, and now it has to settle and remain on ...
Žarko Tomičić's user avatar
1 vote
0 answers
342 views

2D faux gravity walk/stick to a planet

I'm trying , to make a Player walk on a planet , through searching , I figured out that I can achieve this effect using Faux gravity , I tried to Implement it , but it's not working as intended: ...
Abanoub's user avatar
  • 239
1 vote
0 answers
1k views

No Collision while rotating. Object rotating with Rigidbody.Rotate passes through other collider

I'm working on a 3D game, and having issues with the colliders. My Cube Controller has movement input by keyboard, with collider and rigidbody components. Cylinder objects have basic colliders and ...
Sheath9's user avatar
  • 11
1 vote
0 answers
798 views

Maths behind Unity rigidbody.AddForce

I've tried to understand the Maths behind AddForce, as to reproduce it using rigidbody.velocity +=. Based on the formulas ...
Ambroise Rabier's user avatar
1 vote
0 answers
147 views

Root Motion animation clipping through Rigidbody objects? (Unity 3D)

I am trying to program a climbing system. Player has rigidbody, ledge has rigidbody. Both also have Colliders, and the Player animator is set to use Root Motion. When Player grabs ledge and climbs up ...
yunum's user avatar
  • 69
1 vote
0 answers
445 views

With Unity, why this character with a rigid body and child element colliders doesn't collide with the floor and go through it?

I got an issue with my character going through the ground and actually going through all other elements with a collider. I'm going to try and show as much as I can of the current state of things. My ...
nathan raynal's user avatar
1 vote
0 answers
177 views

How to get a consistent behavior for a rigid body hooked platform?

Consider this platform made of RigidBody2D and PinJoint2D objects: PinJoint2D setup is: <...
pietrodito's user avatar
1 vote
0 answers
282 views

How to make a catapult work with physics and colliders?

This should be my final question regarding getting a catapult to throw something in unity. On my last question, someone suggested starting with something simpler (which I apologize for not doing ...
Nathan Wolf's user avatar
1 vote
0 answers
169 views

Large values for Rigidbody Velocity (UNITY3D)

I'm making a simple FPS game. I've come across this problem that I am unable to solve for quite some time. If this is question has already been asked before then do let me know. The problem at hand is ...
TA_800's user avatar
  • 11
1 vote
0 answers
118 views

player softbody

I need some help with a softbody mechanic on a player in unity and I don't know how to approach it yet. I want to try rigidbody collision on individual sections of the mesh, or mess with the cloth ...
Animation Space's user avatar
1 vote
0 answers
170 views

How to prevent Dynamic Rigidbody2d with large mass pushing another Rigidbody2d into BoxCollider2D

I'm making a prototype for a game idea but hitting a problem :( Quite new to Unity and feel like this should be relatively easy to solve, but keep going around in circles, and hoping to get some help :...
pyko's user avatar
  • 493
1 vote
2 answers
323 views

Unity - movement code overriding rigidbody mass?

Unity noob here... I have a basic movement script, but whatever I set the objects mass at it still falls the same speed, floating down off ramps instead of sticking to the floor. I saw some posts ...
herewego's user avatar
1 vote
0 answers
208 views

Unity wall jump issue

I've got a very annoying problem that I have been stuck on for a few days and I can't figure it out. It is for a wall jump. I basically want my wall jump to have a bit of force away from to wall to ...
Remy Limelight's user avatar
1 vote
0 answers
5k views

How do I stop my game character from sliding on the ground?

I am working with the latest version of Unity (2019.3.4f1) at the time of writing. I have some terrain, some blocks as obstacles and a player character with some mouse driven motion controls. You ...
William Calleja's user avatar
1 vote
0 answers
83 views

Circle Collider Vibrates on Edge Collider

I am making a game (kind of bricks) and using edge collider objects as world bounds collider. I am increasing count of balls on each iteration, after 5 balls, balls start to vibrate when they contact ...
YigitOzdemir's user avatar
1 vote
0 answers
80 views

2D Rigidbody with Touchscript movement in Unity won't stay in boundaries

I'm trying to make a pong game where the player has to move both paddles. They are currently set as dynamic 2D Rigidbodies (collision detection continuous) and have a box collider (is NOT trigger) ...
Shelbert Miller's user avatar
1 vote
0 answers
69 views

Control Torque Inputvector

I'm faced with the following problem: I'm trying to implement a rigidbody-based movement for my submarine game which means I want (need?) to useAddForce() and <...
maxi6655's user avatar
1 vote
1 answer
84 views

Dragging a Rigidbody2d without moving other Rigidbodies

There are obstacles and other objects that are draggable. Colliders and dynamic rigidbodies are on the draggable object and there are colliders on the obstacles. The problem is that with the ...
MContributor's user avatar
1 vote
0 answers
38 views

Polygon doesn't bounce enough in edge-ground collisions (but it does in vertex-ground collisions)

I'm currently making a (basic) physics engine in Python in which I want a polygon to bounce off the ground (\$y=0\$). When a vertex hits the ground, I apply the (linear) impulse $$\overrightarrow{P}...
Jonas De Schouwer's user avatar
1 vote
0 answers
1k views

Changing Unity Rigidbody.centerOfMass throws off AddRelativeTorque() calculations

This is an odd one, that has me kind of stumped. If I execute the code: void FixedUpdate() { rigidbody.AddRelativeTorque(0, 1000, 0); } I get this: Normal, ...
Sprocket Creations's user avatar
1 vote
0 answers
575 views

How can I avoid jitter when working with a 2D movement system?

How can I avoid jitter in Unity? Let's suppose that I want to create a 2D movement system using a Rigidbody 2D(Dynamic), and I want make the camera follow the character (which is a pixel art sprite)....
Victor Gadelha's user avatar
1 vote
0 answers
172 views

How can I make a ball accelerate while moving down?

I am making a super monkey ball game. I want my ball to gain velocity while rolling downwards infinitely, and I cannot find any solution to this on Google. I'm new with c# so I am having a hard time ...
loverman's user avatar
1 vote
0 answers
184 views

2D: Scaling a character with multiple RigidBody2Ds?

So, this example is in the Godot Engine, but other engines porbably have this kind of problem, too: I have a character with multiple RigidBody2Ds, that also has a ...
footurist's user avatar
  • 143
1 vote
0 answers
51 views

Kinematic rigidbodies push each other in unet

https://youtu.be/j3f44E-ExLc I have a bunch of rigidbodies on each player, ALL set to kinematic. And this stuff happens. All the sword swinging is animation state driven, and basic back and forth and ...
bobmaxine's user avatar
1 vote
0 answers
421 views

Constant orbit using Rigidbody in Unity

I'm trying to make a few game objects (moons) orbit a planet in unity. Basically just picture a planet in the center of the screen, and a few small moons that orbit the planet with a constant velocity....
DRiFTy's user avatar
  • 576
1 vote
0 answers
452 views

How to convert the unity standard assets first person controller to rigidbody?

I'm using the standard assets first person controller but I just realised I need the rigidbody controller instead. I don't want to switch them out though because I've made a whole bunch of ...
mr-matt's user avatar
  • 2,759
1 vote
0 answers
108 views

Rigidbody Projectile Being Suspended In Mid-Air

I am experiencing problems with Unity's Rigibody feature. Whenever I try firing a projectile, it gets suspended in mid-air. The projectiles are stored in an object pool. Below is the code and images ...
n0t_a_nUmb3R's user avatar
1 vote
0 answers
714 views

Character Movement and Collision with Ragdoll Rigidbodies/Colliders?

I have a player character that I'm moving with a character controller script and it is moved by applying velocity to a Ridigbody. This works when I have a ...
BadmintonCat's user avatar
1 vote
0 answers
3k views

Colliding without physics in Unity: is it possible to put OnTriggerEnter in the moving character?

My main question is: is it possible to put OnTriggerEnter in a script that goes attached to the moving character instead of to trigger area/object? Let me explain my exact need. I want to detect the ...
Louis15's user avatar
  • 569
0 votes
1 answer
29 views

How do I move both the child & parent game objects at the same time?

My current code is: ...
Saltii's user avatar
  • 1
0 votes
0 answers
45 views

Physics Engine Collision Response

I'm making a game engine with my integrated physics engine and I've encountered a problem where rigidbodies tend to over react in collisions and move around without and intention to slow down, I have ...
Gelis 07's user avatar
0 votes
1 answer
126 views

how to rotate my character along the y axis when character is aligned with a slope

I have a capulse character Im moving around in my 3d Game, I usually rotate the character using this line of code: ...
Jambo's user avatar
  • 11
0 votes
0 answers
60 views

Children of a rigidbody are able to move through the floor

I have a problem with rigidbody collisions atm. I have a parent object that has a rigidbody and I am spawning objects that become that parent object's child (the children are all spheres). These ...
Christian Blevens's user avatar
0 votes
1 answer
110 views

Switching a velocity from one rigid body to another in unity

I have a set up where the ground and the player move with physics and a stationary camera. I want the ground to move faster when the player is getting further away making it look that the player is ...
Barreto's user avatar
  • 123
0 votes
1 answer
282 views

Rigidbody drifting after being stopped

I am struggling with an issue in Unity where I am stopping a rigidbody's motion, but after the motion is stopped the rigidbody still moves slightly. It is causing me major issues as I need the object ...
Cato's user avatar
  • 83
0 votes
0 answers
134 views

How to move a Rigidbody2D to exactly match the movements of another body?

I'm recording the velocity of a Rigidbody2D using Animation Curves and I need to reproduce the same "movement" on an instantiated prefab (we really need "stuck like glue" movement ...
Igor's user avatar
  • 219
0 votes
0 answers
237 views

Why doesn't jumping work if character is on upwards slope and moving forward?

I am having an issue where when I hit space to jump, the jump will only work (as in, launch player straight up into the air) only if I am (1) on flat ground (moving or standing still), (2) on a ...
yunum's user avatar
  • 69
0 votes
1 answer
108 views

Bullets shooting all over the place

I have created a simple player controller, which contains the player logic for a movement, aim and shooting bullets from a gun. Everything almost works, except the bullets shoot in random directions, ...
Laurens van Oorschot's user avatar
0 votes
0 answers
437 views

Kinematic Rigidbody parented to a moving Rigidbody gets displaced

I have a kinematic Rigidbody parented to another non-kinematic moving Rigidbody. Render-wise, the child Rigidbody does not jitter, nor does it inherit any displacement changes from the parent ...
LifGwaethrakindo's user avatar
0 votes
0 answers
58 views

Motion of a cube after it bounces off a floor

I am trying to simulate what happens when a cube hits the floor after free fall. I am considering a situation in which cube hits the floor with its edge. There is obviously reaction force from the ...
Žarko Tomičić's user avatar
0 votes
1 answer
51 views

Why is my simple movement script making Capsule go into the air when movement is fast?

I am trying to create a simple movement script. Currently I don't have any jumping implemented; the movement script should just move rigidbody-based Capsule left, right, forward, backward based on ...
m0a's user avatar
  • 115
0 votes
0 answers
228 views

Rigid Body is rolling/spinning on collision, is there a way to have it slide on surfaces instead?

I have a rigid body with a sphere as a collision mesh which can move and rotate freely. It realistically spins when colliding with other objects, but this is annoying from a gameplay standpoint. Is ...
Mazz1224's user avatar