Questions tagged [rigid-bodies]

Rigid body is a solid body which deformation is neglected. The mechanics of a rigid body are completely reducible to the mechanics of material points but it has its own content.

In a rigidBody is a component of a which allows the engine to calculate the behavior of the object and simulate a variety of physical interactions and collisions with other game objects.

Additional information:

Wikipedia article about Rigid Bodies

Unity RigidBody scripting reference

431 questions
0
votes
1 answer

geometric median for rigid body

I need to implement a "geometric median"-type algorithm that would apply to rigid bodies, meaning it would not only find a point minimizing the distance from a set of points, but would also take into account the orientation of the body. I haven't…
-1
votes
0 answers

Unity - Calculating angle of reach toward target

I am working with AI and aim prediction in Unity. I want to predict direction at which fire point should be pointing for bullet to reach an target. I used equation for calculating angle of…
Kiket95
  • 73
  • 10
-1
votes
1 answer

How do you make a rigid body eventually converge to a fixed position?

https://www.youtube.com/watch?v=zz7XJ6bK_YQ What is the best way to think about writing a program for a free-falling, bouncing 2D rigid body like the one in this video that eventually converges (or appears to do so) to a fixed position? If possible,…
wes
  • 1
  • 1
-1
votes
1 answer

Raycasts In Unity Not Detecting Enemy

I've been trying to set up raycasts for a pistol to shoot in Unity, and they will not detect any enemy rigidbodies or deduct health. The enemies are all on a whatIsEnemy layer and have the Tag "Enemy". using System.Collections; using…
-1
votes
1 answer

Character randomly rotating on the X and Z axes even thought Rigidbody constraints are enabled

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UIElements; class FirstPersonCamera : MonoBehaviour { public float mouseSensitivity = 100f; public Transform playerTransform; public…
-1
votes
1 answer

Why it is difference when use AddForce to make the character jumping in 2D and 3D game

I use a same script for both make character jump in 2D and 3D game: using UnityEngine; public class Test : MonoBehaviour { private Rigidbody rb; public float jumpForce; private void Start() { rb = GetComponent(); …
Tien Hung
  • 139
  • 8
-1
votes
1 answer

Flip gameObject when it goes a certain direction

I am making a 2.5D game where the player can only move up, down, right or left; no X-Axis I have the controls set-up like this: using UnityEngine; public class Movement : MonoBehaviour { public float speed = 8; private Vector3 scale = new…
Fghjkgcfxx56u
  • 99
  • 1
  • 11
-1
votes
1 answer

How do I enable/disable gravity in a script in unity?

I am making a plane game and want to add a landing but my controller does not have gravity on so I am wondering how to enable a rigid bodies gravity when a certain speed is reached.
Sheepy KSP
  • 11
  • 4
-1
votes
1 answer

Unity 2d Character moves and jumps to specific positions with UI buttons

In a simple 2d project in which my player can move to the right and left on x and can also jump to the right and left in height with two other buttons. The problem is, that the player is not supposed to move freely. By pressing one of the buttons…
elias_ec
  • 3
  • 3
-1
votes
2 answers

How to prevent upward rigidbody velocity?

I have a group of objects that I allow my player to toss around the scene in zero gravity. However I want to create type of invisible bounds after a certain height. So far when the object reaches a certain upward bounds, I have been doing this in my…
aadu
  • 3,196
  • 9
  • 39
  • 62
-1
votes
1 answer

Only one game object moves in unity when I have 3 identical objects

This has been annoying me for a while and I can't find a solution. Only ground3 moves while the other 2 stay in place. Im using unity and doing a 2d project. Code: using System.Collections.Generic; using UnityEngine; public class GroundMovement :…
Eden Gibson
  • 126
  • 1
  • 11
-1
votes
1 answer

Unity3D - Order list by angle to point

I am trying to make a 2D game in unity. I want to create a convex hull around a group of rigidbody2Ds that I have in a List. To do this, I need to order the List by the angle that each rigidbody2D makes with the start position. Anyone know how I…
flibit
  • 3
  • 2
-1
votes
1 answer

Rigid Body fps controller issues

I'm trying to make my own Rigid body character controller using Unity, I have movement but it's a little weird. When I press A/D it moves my Character along the x-axis, then when I press W/D it moves it along the y-axis. Also right now I have an fps…
-1
votes
1 answer

Box collision 2D Unity, Sideways collision not working

So there is a problem with my box collision in Unity, when my character collides with a box from the top or bottom, it works just fine and gets stopped, but when it moves towards it from the left or right side it does not get stopped which is not…
-1
votes
1 answer

How to collide with a HEROIC FANTASY CREATURES FULL PACK from unity asset store

So I bought the unity humble bundle which had tons of great things for a very cheap price and one of them included the HEROIC FANTASY CREATURES FULL PACK VOLUME 1. I was messing around with it but I realized I had two problems. First is that I can…
1 2 3
28
29