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
0answers
16 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
20 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
17 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
39 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
13 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
25 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
39 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
18 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
25 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
28 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
122 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
23 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
76 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
28 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
33 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
31 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 ...
0
votes
1answer
36 views

Character Controller pulling Table in Unity Engine

I have setup a scene with one GameObject that has CharacterController component (Player) and another one Cube that represents Table with RigidBody and BoxCollider components. Now, when I get close to ...
0
votes
0answers
19 views

Stop the player to prevent it from being thrown away after collision

I'm trying to write a script where when the player (kinematic) comes up against an enemy he stops, jumps and gets dynamic again. The problem is that when it returns dynamic it is thrown away and does ...
0
votes
2answers
212 views

Dragging a Rigidbody2D without passing through obstacles

I have this body of code written for an object that needs to be an obstacle and another object that is draggable. I have colliders on both and a kinematic rigidbody on the draggable object, but the ...
0
votes
0answers
90 views

Unity: Make a moving rigidbody stop exactly at a given distance

I have an object that only moves along Z-axis, its rigidbody has a mass of 1 and a drag of 0.2. That object accelerates till MaxVelocity and then moves at that constant velocity in the Z-axis. When ...
0
votes
1answer
21 views

Unexpected velocity changes in unity

I have a character that moves with a rigidbody. When I jump, it looks fine, but sometimes, my character boosts up while in the air and shoots out of the map very quickly. I checked, and when it ...
0
votes
1answer
46 views

Character doesnt move along with his rotation

Decided to change my character movement from transform.Translate to a rigidbody movement, the only problem is that my character is not moving to where he is facing, also it falls really slowly in the ...
1
vote
0answers
27 views

Polygon doesn't bounce enough in edge-ground collisions (but it does in vertex-ground collisions)

I'm currently making a (basic) physics engine in Python in which I want a polygon to bounce off the ground (\$y=0\$). When a vertex hits the ground, I apply the (linear) impulse $$\overrightarrow{P}...
1
vote
1answer
71 views

Rigidbody script throwing error CS0246: The type or namespace name `MouseLook' could not be found. Are you missing an assembly reference?

I've been stuck on this for the last 3 days and I really need some help. Now, I have 2 scripts that are giving me some grief, the RigidbodyFirstPersonController.cs and the MouseLook.cs scripts. On my ...
0
votes
1answer
41 views

How do I use trigger colliders in Unity?

I am trying to create a "Fruit Ninja" style game in Unity in VR. I have a BoxCollider on my sword set to "Trigger" and I have some "fruit" objects coming towards it. I then have this function: ...
0
votes
0answers
52 views

Client side prediction in 2D rigid-body physics

I'm currently working on 2D rigid-body physics multiplayer game using Matter.js for physics (both the client and server side) and Phaser3 for rendering. Both the server and the client run the ...
0
votes
3answers
175 views

How to stop player when game over?

problem is when game over myplayer not stop?? ...
0
votes
1answer
143 views

Rigidbody character rotation

How could I rotate my character that I'm using a rigidbody to move. I tried using transform.eulerAngles and changing those but the camera feels very jittery.
0
votes
1answer
21 views

Rigidbody2D moves on x axis without adding force

I'm currently trying to learn some Physics2D in Unity. Now, I've created a Ball (sprite) and added a RigidBody2D and a CircleCollider2D on it. The RigidBody2D has the following settings: Bodytype: ...
0
votes
0answers
23 views

Make players Rigibody move in direction its going?

I have my snowboard character which I am trying to fix the movement for. At the moment, The player is using transform.forward on the rigidbody to move forward. If my player turns around and faces up ...
0
votes
0answers
151 views

Raycast collision Detection different results?

So I'm trying to make a collision detection system for a kinematic rigidbody for a gameobject but for some reason the results in which the gameobject stop is always different. I tried missing around ...
1
vote
1answer
78 views

Character moving without control

i've been developing a third person adventure game on Unity with a grappling hook and i found a problem that i don't understand and it's driving me mad. Basically, if the player character collides ...
0
votes
2answers
303 views

How can I create a dice toss that results in a specific value?

I am trying to create a 3D dice for a game. Normal dice has been created by setting cube for dice with Rigidbody and apply force to throw a dice. Now the problem is, the user wants to give a value 1 -...
1
vote
2answers
1k views

Move rigidbody using WASD keys but rotate it based on camera/mouse movement

I am very new to unity and my scripts are based on some scripts found on the web. I want to make a first person view so the camera is attached to my rigidbodys head. Then i want to move my rigidbody ...
0
votes
2answers
29 views

Dividing properties between RigidBody and Collider

I am currently making a physics engine in Rust. The 2 main data structures concerning collision detection are: RigidBody: Physics-related aspects of the body. Contains a reference to a Collider ...
0
votes
1answer
62 views

How to stop Objects with Rigidbodies from explosion when dragging

I have a sequence of capsules linked with fixed join and each capsule have a Rigidbody and a cube collider (the picture bellow shows how it's look like) and this ...
0
votes
1answer
66 views

How to make a rigidbody come to rest faster

I'm trying to move around a 3D rigidbody in Unity 2018.1.0f2 Personal. I am using a C# script with the basic vector3 and velocity stuff from a YouTube video: ...
7
votes
3answers
3k views

How to move the player while also allowing forces to affect it

For now, that's how I move the player: rb.velocity = Vector2.right * input.x; And I affect him a force while he is damaged by an entity: ...
1
vote
1answer
72 views

Is Rigidbody needed and what move function to use in 2D games?

I don't really fully understand how to use rigidbody and which movement functions in a 2D game. There seems to be so many options and it's just a mess in my head right now. If I'm making a game like ...
3
votes
0answers
83 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 ...
1
vote
0answers
125 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
25 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
21 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
1k 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
30 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
98 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
170 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
18 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
35 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 ...