Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
0answers
35 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
23 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
1answer
9 views

Pushing Rigidbody forward doesn't go straight

I have a object that pushing rigidbody forward when it's instantiated: ...
0
votes
1answer
45 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
15 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
0answers
9 views

Why does the position of my BoxCollider2D go to hell when it falls onto a TilemapCollider2D?

Here's what it looks like before hitting play: Notice the transform: the Player Game Object's position is 0, 0.5, and 0. Now when I start the game: Here's a close-up look: What the hell? Initially, ...
0
votes
0answers
8 views

Unity3d - VR - motion controlled hands and ball

setup: I am in a VR environment. My "game" has only two objects: a motion controller controlled "hand" that is rigged and animated (the animation is a grasping pose), and a ball. The ball has a ...
0
votes
1answer
33 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
38 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
0answers
9 views

How do I rotate the child object of a rigidbody? [duplicate]

Suppose I have a game object with Rigidbody component attached. I then create a child object below it. parent->child How do I rotate this child object relative ...
0
votes
1answer
34 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
50 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
56 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
46 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
118 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
41 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
18 views
-2
votes
1answer
31 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
78 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
117 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
82 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
185 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
56 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
34 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
32 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
787 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
667 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
105 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
79 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
257 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
46 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
32 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
0answers
42 views

How can I skate from the current Waypoint till the last endpoint in Unity?

Im making an inline skate game, I want to jump on a trail and grind till the End Waypoint but the problem is the player is going to the first Waypoint then moves to the last Waypoint but I want to ...
0
votes
0answers
31 views

How do I change the Rigidbody's velocity of the player while skating/jumping up a halfpipe in Unity?

I want to make an inline skate game, I have struggle on skating up the halfpipes and when I jump at the top of the halfpipe it should go up straight but if my player is vertically on the halfpipe like ...
0
votes
0answers
44 views

2d side scroller car racing game, can't manage to understand swipe down to forcefully land on ground

I am trying to create a 2d side scrolling racing game. Where my ground is a random 2d terrain. I want to create an effect where when car is in air and user swipes down the screen. The car just ...
0
votes
1answer
453 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
0answers
312 views

How to keep a character from double jumping multiple times in a 3d game?

I am very new at C# and I having difficultly figuring out how to keep my player from double jumping and flying through the air. I know this question has been asked a lot, but I am having trouble ...
0
votes
1answer
2k 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
473 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
59 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
358 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
333 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
407 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
201 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
279 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 ...
0
votes
1answer
31 views

How to set end of joint that has fixed transform?

I'm implementing chains locked the door, and used Hinge joints to linked the chains like this picture: As you can see, last chain doesn't have connected body because it is end. And when the game ...
0
votes
2answers
114 views

Only subtract velocity on one axis

I'm really slow in uptaking this! I have a GameObject with a Rigidbody. Now I add via AddForce a velocity to the y-axis. But after that, I want to lerp it to zero. But how? My problem is, that I use ...
1
vote
1answer
1k views

Unity - How do I make non-convex Meshes collide with physics?

Whenever I add a Rigidbody component to an object with a non-Convex Mesh, Unity throws this error: Non-convex MeshCollider with non-kinematic Rigidbody is no longer supported in Unity 5. If you ...