Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rigidbody]

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

2
votes
0answers
14 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 ...
0
votes
0answers
26 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, ...
0
votes
0answers
23 views

Adding a collider to a wheel in a way that does not interfere with the suspension

I want to add a collider to a wheel so that it does not interfere with the suspension in any way but will allow the car to run into walls or other cars. The implementation of the wheel is as follows: ...
0
votes
1answer
19 views

What are constraints and how are they pluggable?

I have been reading this book called "Game Physics Engine Development" and Came across this image in the context of Collision Resolution. See the contact Generator part. Can someone tell me what are ...
1
vote
1answer
35 views

Unity tilemap collider not colliding with rigidbody

In the wireframe you can see the tilemap collider for this hill. The red circle falls right through however. The circle has a 2D rigidbody attached. Everything is on the Default sorting layer and on ...
0
votes
0answers
29 views

How can I stop my character's velocity in only one direction?

I'm moving a character by setting its velocity. It works perfectly and stops how I want it to however when I'm moving forwards and sideways at the same time and I stop moving either sideways or ...
0
votes
0answers
44 views

why are my 2d game objects passing through each other?

So I've been looking around for a while and can't seem to find an answer for this. I am trying to make a game where you stack shapes as high as possible. I have an OnMouseDrag script so I can grab a ...
0
votes
2answers
22 views

RigidBody.MoveRotation Resetting to (0,0,0);

I'm trying to rotate a character on along the y axis but rather than continuing to rotate, it rotates then the y rotation goes back to 0. I'm not sure what I'm doing wrong. The same thing happens if I ...
0
votes
0answers
17 views

Rigidbody Jump acceleration with no reason

I'm doing some jumping behaiour, and i'm going crazy: I have a planet oriented gravity. When I precisly jump just after my player is OnGrounded, the next jump is bigger (the 2 last one in the pciture)....
0
votes
0answers
30 views

Center of World Map not the same as the center of my Bullet Physics World

As you could see in the image, the center of my map should be located at the intersection of the diagonal lines. When I import 3D buildings within the area into my Bullet physics world, I want to set ...
1
vote
0answers
53 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)....
0
votes
0answers
29 views

Calculating Damage from from object collision

I need to calculate the damage resulting from a crash of two objects. I found the formula of the resulting kinetic energy: E = m * v² / 2 I guess I also have to ...
0
votes
2answers
29 views

Pushing Rigidbody forward doesn't go straight

I have a object that pushing rigidbody forward when it's instantiated: ...
0
votes
1answer
54 views

Physics engine and rigidbody sleep optimization

I am trying to add sleep optimization to my little physics engine(just for learning). I use SAT for collision detection that returns penetration normal and depth without contact points. Objects are ...
0
votes
1answer
25 views

How to give and remove authority of an object between multiple clients (Or how to let the client controller push a rigidbody)

I'm doing a cooperation FPS game in which players can push big rigidbody cubes with their rigidbody characters (the one from the standard assets). The problem is that the player hosting the game has ...
0
votes
1answer
39 views

Unity Rigidbody sitting on top of another Rigidbody does not move with the Rigidbody its sitting on

I have a mesh with a rigid body that moves back and forth like a platform. Other rigidbodies fall onto the upper surface of this cube. The problem I have is that when the platform rigid body moves the ...
1
vote
1answer
41 views

2d sprite topples over due to circle collider

I am completely new to unity nd was trying to create a simple 2d platformer. I a trying to use a box collider and a circle collider for my Player. I am using circle collider because I have heard it ...
0
votes
1answer
37 views

How do I rotate finger joints using controller input?

Suppose I have an index finger composed of 3 cubes which all contain Rigidbody which have isKinematic set to true. In a ...
1
vote
0answers
52 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 ...
0
votes
2answers
108 views

Hinge joint is not firm, leaving connected anchor position

I have a hook with hinge joint which is working fine but as my object quickly move my hook leave its position for a while. And here is the hinge joint settings with rigidbody: Here is a short clip ...
0
votes
0answers
108 views

Colliders going through each other

I'm trying to trap objects inside a room (a hollow 3d object), here's what I have: A 3D object with a mesh collider (not convex) on the inside and a bouncy physics material randomly generated ...
1
vote
1answer
192 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 ...
0
votes
2answers
90 views

Unity3d Move player with UI buttons

I'm trying to move the player based on UI buttons. I found this topic which covers the button listener: https://forum.unity.com/threads/touch-and-hold-a-button-on-new-ui.266065/#post-1944748 Now I ...
0
votes
0answers
23 views
-2
votes
1answer
37 views

Why does my OnTriggerStay method throw a NullPointerException when I access the collider's attachedRigidbody?

I set the trigger void OnTriggerStay(Collider other) { other.attachedRigidbody.AddForce(Vector3.up * 100, ForceMode.Impulse); } But when player walks on, ...
2
votes
2answers
126 views

Unity c#: How to slow down rotation over time?

I am making a space combat game, in which the player can press q and e to roll their ship. I did this by adding torque to the rigid body when the player press q or e. However, after they do so, they ...
0
votes
0answers
186 views

Detecting collisions without rigidbody

I have a car with the following aspect: As you can see, colliders are locally static, because they are separated from the original rigidbody component. Well, as you can suppose, I have a problem, ...
0
votes
0answers
101 views

Object moving by adding force to Rigidbody bouncing off where ground objects met

I have a object that moving by adding force to rigidbody. With just big flat plane, it works fine but with connected small planes, sometimes(actually not sometimes, a lot) the object bouncing off or ...
1
vote
1answer
226 views

How to check if NPCs are on ground or not?

I'm using Unity Engine. I see the common way to check if player is on ground is shooting a Raycast: How to solve the ground check problem? How to check if grounded with rigidbody I have a simple ...
1
vote
1answer
64 views

Rotate player to a specific angle using Rigidbody2D

First of all, I'm an absolute beginner in unity and coding so please excuse my lack of knowledge and my mistakes. I didn't achieve to fix my issue with others posts. I'm trying to do a little top-...
0
votes
0answers
43 views

Elevator and jump Rigidbody Player problem

I have an Elevator and Rigidbody Player. Settings are below. Problem is that Player can't jump easily from the Elevator because he has Maxfriction material. If I set zero friction, he than bounces ...
0
votes
1answer
35 views

Circle colliders dont work

I have a destination and 2 players. I want the players to reach the destination and not overlap in the process. I attached to each player a circle 2D collider and a rigidbody 2D. Also this script: ...
1
vote
3answers
1k views

Problems applying movement to a RigidBody in Unity

I'm working on a driving game, and I've been using RigidBody.MovePosition (non-kinematic) to move the car. I've read that this is not the best method for physics reasons, but I've had massive ...
0
votes
2answers
899 views

Unity, rb.MovePosition and transform.Rotate at the same time

I can't figure out why my object can't move and turn at the same time. ...
0
votes
0answers
120 views

Rigid body addforce turning

I want to use rigidbody addForce or addRelativeForce for the movement of my ship because its feels very flighty. My ship is actually a child to a parent that makes the ship travel on a rail. (game ...
0
votes
1answer
91 views

Rigidbody has unintended effect, velocity limiter from unknown source

I have made a script that alters a rigidbody's angular velocity. It works well but has one issue, its speed plateaus past a certain point. Here is the script: ...
1
vote
1answer
286 views

Make a game object move inside circle and bounce from walls without gravity

I have a circle with a RigidBody2D and CircleCollider2D components on it. I'm trying to make it move constantly inside a bigger ...
1
vote
0answers
49 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 ...
0
votes
0answers
34 views

have humanoid animation effected by physics

so i have a astronaut with some random floating animation on it, but when i add force, for example when his jetpack is thrusting forward, i want his limbs to be "left behind", like how you push a ...
0
votes
1answer
537 views

Unity Rigidbody stops directly after moving

I'm creating a skating game, my Idea now for moving was when I move and then dont press any button anymore to move, it should still roll a bit and decrease momentum after a short while to fully stop. ...
0
votes
1answer
3k views

Proper way to set a RigidBody's maximum velocity

I am trying to gradually accelerate a GameObject with a RigidBody attached until it reaches a maximum velocity, at which point it becomes unable to gain any more velocity. I know I can simply reset ...
1
vote
1answer
1k views

Problem when trying to use rb.MoveRotation in Unity

OK so I learned that rb.MoveRotation is different from rb.transform.Rotate(). But I am having trouble using it and hoping you can help me. I usually use transform.translate(Vector3.forward) (after ...
1
vote
1answer
592 views

Should I change velocity or apply force to implement a jump in Unity?

I have started making a basic platformer game just for fun. Its going to be the style of the original Super Mario Bros game, but with 3d assets. My problem is that I'm using a rigidbody and using ...
1
vote
2answers
62 views

Box collider/rigid body eventually moves through static collider

I found this question, but I'm not sure if it applies to my problem. I'm hacking together a Pong-style game, and my problem is with the walls (box collider, no rigid body) not completely stopping ...
2
votes
1answer
379 views

How can I rotate RigidBody and not violate physics?

I'm trying to create a game that we have a falling ball and an spinning object that spin based on user mouse position. user should rotate the object and hit the ball on time to throw the ball into sky....
0
votes
2answers
105 views

Issue giving object player's hand position

I'm trying to put an object (for example a sword) in my player's hand. To do so i set the player's hand transform as the object's parent, in order to have the same movement for the object and the hand....
1
vote
3answers
401 views

Rotate Rigidbody2d slowly for 360 degrees

I would like to perform a 360 degree rotation on a GameObject with rigidbody2d component. You should be able to see the rotation, so I thought of rotating the object 8 times with 45 degrees each ...
3
votes
2answers
511 views

Using collision.contacts to determine if on a floor

I'm trying to make my own first-person character (because I get lost in the sea that is Unity's FP character script), and am trying to make it so it detects when it is standing on a floor. I tried ...
1
vote
1answer
266 views

Character on platform move slowly

I'm having a problem similar to this link: http://answers.unity3d.com/questions/1295955/character-on-a-moving-platform-slows-down.html But... My 2D character is on an elevator (which does not have ...
0
votes
1answer
334 views

Removing Hinge Joint from script doesn't work

I'm facing serious problem with handling hinge joints dynamically in Unity. I made bunch of chains and they are all linked for make something like "sealed door". When I remove HingeJoint component ...