Questions tagged [rigidbody]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
680 views

Unity : how to Rotate GameObject back to Indentity position?

Hello i m trying to rotate my object smoothly over MouseButtonDown and rotate to identity position on MouseButtonUp and this code rotate my GameObject smoothly but it won't come back to identity ...
2
votes
1answer
846 views

Why does applying force to a game object apply force to children, as well?

I have a script on my player to move. I do not have root motion applied because, root motion does not work perfectly so I'm manually adding velocity to the player. The player is holding a ball and ...
0
votes
2answers
262 views

Nestling into contact with a group of physics objects without exerting forces on them

I'm making a pool game, and would like the circle (imaginary) to be in contact with the table and balls, and to fit perfectly as a ball would. Now I thought I would use Rigidbody and lerp the ...
0
votes
1answer
1k views

Character on Moving Platform Shaky. How to Fix?

I have an elevator (rigid body platform) that is meant to transport a character. The character (RigidBodyFPSController) shakes while platform descends. What is an elegant way to fix their relative ...
0
votes
1answer
1k views

Objects do not stop when colliding each other while using mouse drag

I work on a 2D game and I have multiple objects that the player can control. The objects each have a RigidBody2D and a Collider, and a method OnMouseDrag() with ...
0
votes
2answers
2k views

Unity: Moving player using Rigidbody with UI Buttons?

i have been using transform.positionsince the start but now i want to switch to rigidbody instead since i am facing some collision problems. i can use the keyboard ...
0
votes
1answer
50 views

Player object glitching around when there is a low framerate Unity C#

I just started to make this game, it runs fine on my computer. 60fps, but when I tested it on another computer, with lower fps, the player just started to jitter and glitch around a lot. The game is ...
0
votes
0answers
27 views

Fix player movement?

My character follows camera direction. my issue is when i look at sky and walk or run my character goes up ! the same thing happen when i look down and walk back. ...
0
votes
1answer
549 views

How do I correctly use GetComponent to get the rigidbodies of each element in an array of colliders?

I was trying to implement an AddExplosionForce-script that was shown in a Unity live training session a few years back. It has out of date calls to rigidbodies because it uses the old ...
0
votes
2answers
1k views

Rigidbody or Character Controller for a momentum based sidescrolling shooter/platformer?

I'm working on a side scrolling game where among other movement options the player can perform a "bullet jump". The bullet jump fills a similar role to a double jump, but instead of just jumping in ...
1
vote
1answer
1k views

Unity 2D Bullet AddForce does not work

I got the following code : ...
0
votes
2answers
2k views

How to change size of collider attached to UI Image in unity

I have a circle image which has a Cicle collider 2D and Rigidbody 2D attached to it and its size (width and height) is constantly increasing in script like this: ...
1
vote
1answer
237 views

Why does the box rotate, spin instead of gliding?

I've just learned that if I want to move an object so it acts depending of physics, I need to use rigidbody.velocity instead of ...
1
vote
1answer
311 views

Box collider pushes me out of it's area slowly, I can pass through it if moving quickly

I am new to Unity. I Setup a character in unity2D with a rigidbody. I had the scale off my sprites set to 100 pixels per unit. At this scale, my rigidbody character stood on top of platforms and could ...
1
vote
2answers
59 views

Limiting interaction between certain RigidBodies

I'm developing a 2D game in Unity and have been tasked with building a particular feature I'm not sure how to accomplish with Unity's physics engine. To simplify, a bunch of objects of type X and O ...
4
votes
0answers
787 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 ...
1
vote
1answer
51 views

Platform Cannot move down when player collide buttom of platform Unity?

In my unity game I've arrange different platform ,when my player collide with upper part of the platform so platform falling down but issue that when my player collide to platform buttom of part so ...
0
votes
2answers
1k views

To Unity Rigidbody move like Character Controller on collision

I want to a blue ball moving like a figure. in CharacterController, it was possible. but in Rigidbody, object was stucked. help me.
1
vote
1answer
299 views

Copy velocity of one object to other object

I have a script to pick up items with a VR controller. I connect the object to the VR controller through a FixedJoint on a rigidbody ...
0
votes
2answers
60 views

How to avoid an applied force from effecting one particular Rigidbody2D

I am creating a 2D side-scroller car race game with zombies. In this game, I set up a feature through which the player can shoot the zombies from the car, as well. The problem is that when I apply ...
4
votes
1answer
1k views

How do I add a smooth force my player's rigid body, to make them jump?

I am trying to add force to the player's rigidbody, when the screen is held. I've written the following code: ...
1
vote
2answers
205 views

Unity2D - move rigidbody object with collision

How do I move and collide my object (position given by touch or click), by Using rigidBody2D.MovePosition i can only teleport my character, and by using velocity, my character keeps moving, I want him ...
1
vote
2answers
504 views

Unity2D - collide with objects while moving to a position

How do I get my character to collide with other objects while moving to a position? All I've managed to do is change the position, it only collides if the character is not moving, it's like he is ...
1
vote
0answers
46 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 ...
2
votes
1answer
1k views

How to add constant force to player with sperical gravity planet.?

I have a planet and character. My player move perfect around planet with pressing key like 'w','s','a and 'D'. I want to move my player on every frame with same force around sphere. I try plane ...
1
vote
2answers
133 views

Changing speed of an object

Is there a way of changing speed of an object at certain time? I want to change my speed to my initial speed after colliding with any object. I have already added bounce Physics to my colliding ...
-1
votes
1answer
543 views

How to give a mesh collider gravity 5.0

I was trying to make a simulation of an object that needs gravity to work, a hydraulic movement-assistance system for disabled people. All parts are aligned properly, all objects have mesh colliders ...
0
votes
2answers
61 views

Moving towards and switching targets in Unity with collision

I have these nodes set up for a ship to move towards over time with out looking stops then repeats in a sequence. like so: 1 2 3 1 2 3 1 2... THE PROBLEMS i keep having either come from the ...
0
votes
1answer
349 views

Bullet: Apply any Transformation to RigidBody?

I'm using Bullet for CollisionDetection. I load a scene from a Collada-File using Assimp. Let's say I want to give every object in the scene a RigidBody with a box as CollisionShape. Right now I first ...
1
vote
0answers
291 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....
1
vote
1answer
6k views

Unity 3D Move Object with RigidBody

I have added RigidBody component as well as Mesh collider to an object moved with keyboard. I know that it the object will go through another (with RigidBody and Mesh collider too) if I use transform ...
0
votes
1answer
108 views

My bullet keeps going up

So I have a bullet script that fires a bullet straight in the Y direction that gets called as the bullet is instantiated. The plan is to always shoot in the same direction, straight in the Y, but to ...
1
vote
0answers
412 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 ...
0
votes
1answer
222 views

Wwise with Unity Rigidbody 2d or Collider 2d

I'm half way in making a 2D game in Unity and found that Wwise needed the game objects to have a normal 3D RigidBody, since that's quite some work to replace everything, is there any way around?
2
votes
1answer
379 views

How to replicate Unity's Rigidbody.AddForceAtPosition in C++?

I am trying to replicate the function Rigidbody.AddForceAtPosition of Unity in C++, it means, to apply force to a body offset from its center. How could I achieve that in C++?
2
votes
1answer
398 views

Unity rigidbody exhibits a premature max speed

In effort to build a racing simulator, I have been working on a working model for the pistons in the engine, and have come to a bit of a stand still. I have gone through extensive testing, through ...
2
votes
2answers
373 views

Rigidbody2D Circular Orbiting

I am trying to create a basic solar system in 2D. All space objects has CircleCollider2D on them (which are required for raycasting in another script). Currently planets are childs of stars, and ...
0
votes
1answer
90 views

Unity - Copy another object's Y location?

I'm creating a Pong clone inside of Unity and was trying to figure how to copy another object (In this case being the Y co-od of the Ball Object) How would i go about doing this? I'm using vectors as ...
1
vote
1answer
664 views

Unity: Adjusting 2D physics for different mobile resolutions

I created a test project to see how different mobile resolutions affects Unity's 2D Physics. They way I handled the resolutions was to contain all the objects (including non-UI objects) in a Canvas ...
4
votes
1answer
205 views

Set input relative to map rotation?

I'm trying to figure out how I can make the input which looks like this : ...
1
vote
1answer
3k views

Rigidbody AddForce() skipping/teleporting

I'm surprised that this issue is nowhere to be found on these forums... Well at least when I searched. So, on my setup I have created a cube and applied a Rigidbody to the object with the following C# ...
1
vote
1answer
166 views

Unity C#: Game Object Movement Issue

I'm trying to move a game object within a set x and y range. I thought the code below would work, but it does nothing. The idea is the player controls the platform and tries to move under the ball. ...
1
vote
2answers
590 views

How to apply force to rigid bodys at a specific point?

I am trying to write a physics engine from scratch to get a better understanding of them. It worked pretty good so far, but there is one thing, i can't get my head around: If i have a rigid body ( ...
1
vote
1answer
1k views

How to get dynamic RigidBody rotation/tilt on uneven platform?

I have a rigid body with PolygonCollider2D which has some complex circular shape and I'm using uneven platform. Im using Following code to move the object forward ...
1
vote
2answers
1k views

How to make rigid body move smoothly on uneven platform?

Right now I'm using Rigidbody2d for the game character along with polygon collider 2D(2d platform game). I'm beginner hope I'm using correct components. And transform to move character from left to ...
0
votes
1answer
1k views

How to disable Camera from tilting when following a game object?

I have a game character object which is followed by camera. Camera is child object of Character. Using rigid body makes the character tilt in slopes and camera tilts too. how do i stop camera ...
1
vote
0answers
72 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 ...
0
votes
1answer
151 views

Ball Speed is not increasing as per code

I am working on small project , but now I have a problem . The problem is The Player speed (Ball speed) is not increasing as per the code . In the beginning ball speed increases , but as the time ...
1
vote
1answer
99 views

My rigid body controller stuck in middle of screen (unity)

Still working on my Star Fox clone and am changing up the camera a bit. The problem I keep having is my Ship gets locked in the middle of the screen and can't move while its parent (spinMe) is still ...
0
votes
2answers
2k views

OnTriggerEnter() without rigidbody?

I know this is an old question and it has been answered for a lot of people. Unfortunately none of the solutions apply to the problem I seem to have with rigidbodies. I have a moving AI character and ...