Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [rigidbody]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
83 views

What exerts a force on my rigidbody?

I'm trying to create a simple 2D scene with two rigidbodies, which are connected by two pin joints. There is one large rigidbody, a green circle, which is slowly rotating at a constant speed (as its <...
F-H's user avatar
  • 111
0 votes
1 answer
30 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
51 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
2 answers
62 views

How to implement rigidBody movement and collision in local axis X while moving the body automatically in local Z axis?

I'm making a very peculiar outrun clone. I need the player to move forward automatically while being able to change his position on the road in his local X axis. I made infinitely generated road and ...
NationalGeographicProgrammer's user avatar
0 votes
1 answer
47 views

AddExplosionForce in 2D

Its a pretty simple question. I have a gun that shoots bullets, to make the game more fun i want the bullets to be used to navigate. For example shooting them below you would make the player jump up. ...
Pow's user avatar
  • 404
0 votes
1 answer
26 views

Can't move rigidbody2d when using animations

I have a player moving and jumping by changing its x or y velocity. It worked well until i created a walking and idle animation. Now, the player is animated correctly when idle or walking, but does ...
Usylom's user avatar
  • 21
0 votes
2 answers
98 views

Why is my enemy not moving?

I'm trying to make a 2D Unity platform game for a school project, but I can't seem to get the enemy to move. ...
TheEpikDuck's user avatar
1 vote
1 answer
70 views

What would be the best way to gradually increase the speed of a 2D arcade game with gravity physics in Unity?

I'm somewhat new to Unity, so I'd like to hear some more experienced thoughts on this. I'm using C# if that helps. I'm currently working on an arcade game somewhat similar to "Doodle Jump" ...
soxyo's user avatar
  • 13
6 votes
1 answer
495 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,127
3 votes
1 answer
2k views

Why objects are falling equally in Unity

I have different game objects with rigid bodies, each having its own mass and drag. However, when these objects fall, they appear to fall at equal speeds. This raises the question of why they do not ...
Muhammad Faizan Khan's user avatar
1 vote
1 answer
263 views

Rigid bodies sliding off slopes

Kinematic bodies have a simple class that makes the player not slide on slopes, but for rigid bodies? I tried using rays and areas, either to lock the player on an axis or to just straight up disable ...
Cei's user avatar
  • 863
1 vote
1 answer
111 views

Rigidbody2D goes over destination when moving with Vector2.Lerp

I'm rounding the position of an object (the blue cube) when the player stops pushing it using ...
Samuel Fyckes's user avatar
1 vote
1 answer
169 views

How to prevent colliders from knocking each other back before being destroyed?

For context, I have a player that can use a bow or a spear to shoot enemies in a 2D side scroller game. The bow shoots arrows and the spear shoots itself, and they both have rigidbody2Ds attached. ...
Peecee's user avatar
  • 13
0 votes
2 answers
127 views

Struggling to launch my player backwards after it comes into contact with an enemy object

I am pretty new to Unity... watched quite a few of Brackey's and other YouTube videos along with a lot of research. I have been trying to add an impulse to my player so that after it comes in contact ...
shanksVR's user avatar
0 votes
1 answer
134 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
61 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
112 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
292 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
  • 93
0 votes
0 answers
140 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
2 answers
129 views

How to convert slope handling code to work with AddForce instead of AddRelativeForce?

I an using the following code for handling slopes: ...
yukjaly7's user avatar
0 votes
0 answers
240 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
1 vote
1 answer
66 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
2 votes
0 answers
58 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
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
458 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
1 answer
128 views

How to adjust speed based on the angle of the Vector3 you are following?

I'm applying forces to a Rigidbody rb. The forces come from points along a spline splineComputer. The code says "find ...
m0a's user avatar
  • 115
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
40 views

LedgeClimb script not choosing point to grab correctly when encountering Stacked meshes (meshes on top of one another)?

I created a script to climb ledges. It shoots 4 raycasts total: -2 shooting straight forward from player (origins left and right of player) -2 shooting down from forward&above player (origins left ...
m0a's user avatar
  • 115
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
234 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
0 votes
0 answers
57 views

Different approaches to rigid-body movement

I'm a beginner at game development and I'm building my own physics game engine to grasp the concepts. I wonder if there are different approaches to moving and rotating a rigid body. For example, ...
mcas's user avatar
  • 1
0 votes
1 answer
84 views

When I rotate a game object, it keeps moving the same direction

When I try to rotate my game object, it keeps moving in same direction. I think there is pretty basic solution but couldn't figure it out. Here is my code: ...
Ivan's user avatar
  • 337
0 votes
1 answer
128 views

How to move on vertical wall with gravity ticked for rigidbody

I am making a ball-rolling game. I want to implement an interaction where the ball can move on a specific area of a vertical wall like the game that the images show, but I don't know how to implement ...
YOUNG ETHAN's user avatar
0 votes
1 answer
62 views

How to find combination of vectors to equal target velocity?

I have a space craft in a 3d world that moves along the X Z plane. Given that I have 4 thrusters with one at each cardinal direction, and the ship can rotate itself about the y axis. Is it possible to ...
Jeremy's user avatar
  • 15
2 votes
1 answer
475 views

Use one collider for Rigidbody2D.Cast, and another for a hurtbox

I'd like to do the following: Characters (player, enemies) have a collider for collision with the world (= other characters/obstacles/etc) Characters have another collider acting as a hurtbox (most ...
Gerrit Begher's user avatar
0 votes
1 answer
273 views

Imitate simplified bird-flight behavior

I am developing a first-person player movement in which the player should "fly" in the direction of his local forward vector. This is working perfectly fine, however, when I turn the player ...
Omer Simchoni's user avatar
0 votes
0 answers
98 views

Problems with knockback implementation

In 2D platformer I'm having difficulty with knockback feature that happens when character touches enemy. That's implementation of it. Character.cs: ...
FeelZ's user avatar
  • 1
0 votes
1 answer
85 views

Player is able to interact with objects but enemy isn't able to

Newbie here, I have a player script that interacts with objects just fine and I made an enemy script for the same object and it gets completely ignored: Below there are 4 scripts. The ...
desperrrr's user avatar
1 vote
2 answers
620 views

Why is Vector3.ProjectOnPlane() "drifting" further from desired rotation on steep slopes

I'm writing a simple player movement script in Unity 3D, and I've been using Vector3.ProjectOnPlane() to accomplish slope/ramp movement. For the most part, this ...
Mr. Slug's user avatar
0 votes
1 answer
490 views

how to have player stay on a rotating platform?

Im making a top down game in unity. in my game there is a platform where the player can stand on. while this platform is moving the player moves with it. here is an example: This almost works like i ...
yente paternotte's user avatar
2 votes
1 answer
196 views

Why do physic engines apply force fully linear, despite adding torque

I checked how the applyForce function on rigid bodies in 3 different physic engines work (cannon.js, matter.js, PhysicsJS) and it seems that this is the common way ...
Bastian Born's user avatar
12 votes
2 answers
4k views

Moving player inside of moving spaceship?

INTRO: I am trying to achieve a spaceship that flies through space and the pilot can get out of their seat and walk around the ship and place physics objects in it while the ship is moving, rotating, ...
Object's user avatar
  • 289
0 votes
0 answers
307 views

How can I pragmatically move a navmesh rigid body when changing scenes?

I have an object with both rigid body and NavMeshAgent attached Which I want to set to a new location on scene change, but there is something weird going on with it. If I just try to set the position ...
Michael's user avatar
  • 101
1 vote
0 answers
358 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
0 votes
0 answers
341 views

Plot rigidbody path simulating magnus effect

I am trying to create a method that will plot the path a rigidbody will take when simulating a magnus type effect with no gravity in Unity. I realize this approach is a drastic simplification to the ...
AAron_-51's user avatar
1 vote
1 answer
142 views

Making interacting gears in 2D

I want to create mutually rotating gears for a puzzle game. I looked at a lot of material, but didn't understand how to make a RigidBody2D stay in one place correctly and interact with each other. ...
Андрей Тарасков's user avatar
0 votes
1 answer
1k views

Why do colliders have a tendency to spin and develop crazy angular velocity in Unity when used as my "player"?

I am trying to create a basic collider for a rigidbody player in Unity 3D. I have been experimenting with numerous shapes but found it hard to get what I want. The primary issue seems to be if the ...
mike's user avatar
  • 481
1 vote
1 answer
206 views

How do I apply real time physics to a 2D game in Java?

I'm developing a 2D Brick Breaker style game in Java and want to apply some real time physics to it, especially to the paddle/ball interections. Nothing too complex; just applying some of the physics ...
Andre's user avatar
  • 13
0 votes
0 answers
14 views

Unity3D object falling from high are passing through ground [duplicate]

First, you can see the bug in action here: https://www.youtube.com/watch?v=vqbo3rweEmA When rigidbody objects are falling from high position (300 in my test), the ground collision doesn't works, the ...
Ben's user avatar
  • 101
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
2 3 4 5 6