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
2answers
24 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 ...
0
votes
0answers
44 views

Why is my movement not smooth and jagged?

My game isn't smooth, it runs at 60 fps but has quick lag spikes just under every second. I really can't figure out why. I have a feeling it's to do with my player movement code. My rigidbody's ...
0
votes
1answer
29 views

Rigidbody player controller on moving platforms

So basically, I was trying to make moving platforms. When I finished my prototype, I noticed that the movement on the platform is very wobbly: https://www.youtube.com/watch?v=hmBumsrlHGA&feature=...
0
votes
1answer
30 views

Animating MultiPart 2D Character with RigidBodies

Some background to the question: I am attempting to animate and control a large multi sprite 2D Boss character for a platforming game. Up until this point I had been assigning individual animators for ...
0
votes
1answer
16 views

Why doesn't this movement script work, while the other one does?

Im trying to get a rigidbody2D to move around and got it working with this script: ...
0
votes
1answer
40 views

How to control rotation of rocket thrusters

I want to make rocket something like this: Those triangle things are thrusters. I want to control rocket by rotating the thrusters and using differential thrusting. (I mean two thrusters will have ...
0
votes
0answers
25 views

Making a Rigidbody return to being level

I am working on a game where mouse input affects the torque of the RigidBody but I would like the Rigidbody to return to being level if certain conditions are met. Currently the angling working ...
0
votes
1answer
24 views

How to detect unknown forces on pool re-used rigidbody?

I have a ragdoll which performs dying quite well when it is initialized. But when the same prefab object is re-used by being pooled and recycled, it jerks violently when die. As if some forces were ...
0
votes
1answer
25 views

Object floating on “top” of tilemap

I've made a character design and added Rigidbody 2D and Box Collider 2D to it but when I put it on top of the ground which is in ...
0
votes
1answer
21 views

Set Rigidbody velocity in FixedUpdate() or Start()?

I'm developing a simple 2D game in Unity (balls hitting bricks), so I have a ball and I want to fire the ball to hit bricks. Now, to fire the ball I have to set ...
0
votes
0answers
16 views

Unity3D: Create scripts to climb a ladder

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 kinematic, but with AddForce. I tried to ...
0
votes
1answer
25 views

collision detection and normals from rigidbody

Until now I've been developing my player character using a Character Controller, but have since decided to switch to rigidbody due to the controller's limitations. In order for my movement code to run ...
0
votes
0answers
21 views

Using an objects velocity to determine if it falling on a player will kill it [duplicate]

I've been attempting to make a falling object kill a player, but i still want to make sure the player can touch and interact with the object to move it around without dying. The code i've made so far ...
0
votes
1answer
80 views

Rotate Rigidbody to face away from camera with AddTorque

I have a camera that rotates around an object with "Look At" . I want the object to rotate to face the direction the camera is pointing (Camera.main.transform.forward) using AddTorque, but I can't ...
0
votes
0answers
18 views

Unity : How to make ships slide around a planet smoothly

I'm making a game similar to galcon/phage wars and I'm stuck at the part where the fleets when travelling from one planet to another,if they hit a planet that is not the target then they should go ...
0
votes
0answers
16 views

Bullet: Mesh dont follow rigidbody transform

My mesh drops after a while when rigid body turns green. Maybe I sound wierd, but I am new to bullet-physics and 3d stuff, and don't know the actual cause ;P It happens on using MotionState. Initial ...
0
votes
0answers
20 views

Why does rb.velocity blurrs background?

My player controller code is bellow. So is my player inspector. This makes my character move yet it blurs the background, but when I use ...
0
votes
0answers
27 views

Torque applies to one wheel, but inconsistently to the other wheel

I have a GameScript class which is derived by another class WheelScript; it is meant to apply torque to a rigidbody in different ...
0
votes
0answers
23 views

Rigidbody with many colliders has strange inertia

I've had some feedback from my game that "gravity feels weird and moon-like". After some investigating I found that some of my objects do indeed behave as though they are on the moon. I can confirm ...
1
vote
0answers
27 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 ...
0
votes
0answers
6 views

(2d) Error pops up when handling enemy knockbackS [duplicate]

So I created some code that will make the enemy take knockback upon taking damage from the player. I put this behaviour inside the EnemyInheritance script so that every enemy I have in the game will ...
0
votes
0answers
9 views

Unity: Stop Rigidbody from moving in one direction [duplicate]

I move a rigidbody by moving the mouse. I want my rigidbody to stop moving in the x direction when it exceeds a certain range. To do that I set the x velocity to 0. If I log the velocity, the x-value ...
0
votes
0answers
20 views

Grappling hook script sometimes causing jitter

I am trying to implement a grappling hook mechanic. My grappling script is attached to my camera that is attached to the player. Sometimes when I try to grapple onto a wall, it causes jitterting ...
0
votes
1answer
31 views

How do I get the player to collide with another object to use as a boundary?

I'm trying to make a simple game where you move a sphere from left/right and try to avoid falling cubes. If a cube touches the player (sphere), the player dies. I'm trying to set up boundaries using a ...
0
votes
0answers
32 views

Rigidbody appears to jitter when placed as a sibling to a First Person camera

In my game, the Player can pick up an object (which gets parented to the first-person camera), or the player can push an object (which is parented to the player, but not their first-person camera). ...
0
votes
1answer
36 views

Unity 2d circle collider not stopping after collision with box collider 2d

I'm using unity circle collider 2d and rigid body 2d but when it hits the box it doesn't stop there but instead just pass through and fall. Can someone help? Circle Collider and rigid body 2d setting ...
1
vote
0answers
71 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 ...
1
vote
1answer
79 views

When setting Rigidbody.isKinematic true collider won't work anymore

I have a rigged 2D character and used Collider2D/Rigidbody2D/HingeJoint2D to body parts to implement ragdoll. It works fine, but I needed to run ragdoll physics only when character is dead. So I made ...
0
votes
2answers
196 views

Is it possible to detect a collision between a sprite and a UI image in Unity?

I have a stationary sprite with the tag "Player" with a Rigidbody2D (dynamic body type and discrete collision detection) and circle collider 2D. I also have a moving UI image; also with a Rigidbody2D ...
0
votes
2answers
52 views

How to calculate the post Rigidbody2D velocity vector before applying a specific force in Unity?

I am trying to implement a space rocket in 2D. Whenever the player presses a button, a constant force (Both vertical and horizontal) is being added to that rocket. What I want to add is a maximum ...
0
votes
1answer
143 views

Can a GameObject be both 2D and 3D?

In all Unity games I saw so far, every object is either 2D (with RigidBody2D and Collider2D components), or 3D (with RigidBody and Collider components). This makes sense, but I wonder if there is any ...
0
votes
1answer
84 views

I need an analytic formula for 3 arms inverse kinematics system

I need an Analytic formula for 3 arms IK system_. I'm currently using Fabrik and CCD solutions but I'm facing low-performance and accuracy issues. So now I'm looking for an Analytic formula. I'm ...
1
vote
2answers
171 views

Why does my first person camera attached to a rigid body vibrates?

I'm trying to make a first-person character with a rigid body. I need a rigid body because I want to add areas where the gravity comes from different directions so I also need to rotate the character ...
0
votes
1answer
53 views

Vertical push doesn't let the object fall down instantly [UNITY]

An object (Wall) is continuously moving forward on the X axis with a simple script: ...
-1
votes
2answers
40 views

Unity: RigidBody2D, Trying to Set rb;

So for Unity I've been trying to to do the code line public RigidBody2D rb; I've followed the gmetrix unity programming course and they do that just fine with the ...
1
vote
0answers
21 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 ...
0
votes
2answers
156 views

Ensuring dash toward mouse position is always a consistent distance

I'm making a 2D game where the player character should dash toward the mouse position when the player clicks, but the dash is currently not a consistent distance each time. Let's say you put the ...
0
votes
0answers
90 views

Elastic Collisions in Unity 2D

I am trying to create elastic collisions in 2d game in unity. I have a ball surrounded with a polygon collider and im calculating the reflected vector using the ball velocity and the normal at the ...
0
votes
0answers
59 views

Applying movement to a Rigid Body Isometric in Unity 3D

I'm making an isometric dungeon crawler. I initially used transform to get isometric movement and things worked well, but I couldn't use collision which meant it was unsuitable. So I'm now trying to ...
0
votes
2answers
40 views

How do I tag an empty space for an 'InAir' Boolean?

I've been working with my game's settings to get the perfect jump height, gravity and movement that suits the player, however my problem is my player essentially floats back down to the ground, when I ...
1
vote
1answer
51 views

body_entered signal won't emit when rigidbody collided to rigidbody

I have multiple rigidbody object floating away in the space. When they hit each other, they push away each. I want to destroy object if they hit something, but connect body_entered signal won't ...
0
votes
1answer
32 views

KinematicBody returns null to try get collided Rigidbody

Player is a KinematicBody and enemy is a Rigidbody. I'm using move_and_slide() to move player. When they collided, each both push them opposite direction, so it seems like physics stuffs working, ...
0
votes
1answer
36 views

Updating RigidBody rotation and velocity only updates it's rotation

I'm currently making spaceship controller script. Control is simple, W/S to move forward/backward, A/D/ to rotate ship by Y Axis(yaw). Spaceship is RigidBody node and has CollisionShape as children. ...
0
votes
0answers
124 views

Unwanted angular velocity in unrelated axis (rigidbody simulation)

so real quick I'm simulating 3D rigidbody dynamics. This is what I have: ...
1
vote
0answers
40 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) ...
0
votes
1answer
245 views

In Godot, how to make a Kinematic body affectable by rigid bodies?

Background Info I'm currently following the FPS tutorial from the official site. By the end of Part 1, there is a Player object implemented as a KinematicBody and ...
1
vote
0answers
58 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 <...
-1
votes
1answer
66 views

How to make wheelcollider not stutter when moving on high speed?

I have a wheelcollider attached on a rigidbody and i move the object using : "transform.position += transform.forward * speed * input.getkey(keycode.uparrow)" And when the speed increasing the ...
1
vote
1answer
35 views

How to set the force applied to RigidBody2D depending on the time user holds touch on screen?

I trying to make an object jump from 1 point to another point. How far it jumps depends on how long the player holds the touch anywhere on the screen. It jumps when player releases his touch. At the ...
1
vote
1answer
41 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 ...