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
1answer
30 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
26 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
12 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
59 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
38 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
101 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
48 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
131 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
75 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
90 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
45 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
32 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
18 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
76 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
43 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
47 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
29 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
31 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
31 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
27 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
150 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
45 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
34 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
67 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
21 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
410 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
164 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
54 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
108 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
61 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
80 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
252 views

How to stop player when game over?

problem is when game over myplayer not stop?? ...
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
155 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
106 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
398 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
2k 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
37 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
81 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
114 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
120 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 ...