Questions tagged [rigidbody]
In game development, a rigidbody is usually referred to anything that is affected by physics.
257
questions
0
votes
1
answer
31
views
how to have player stay on a rotating platform?
Im making a top down game in unity. in my game there is a platform where the player can stand on. while this platform is moving the player moves with it. here is an example:
This almost works like i ...
1
vote
1
answer
46
views
Why do physic engines apply force fully linear, despite adding torque
I checked how the applyForce function on rigid bodies in 3 different physic engines work (cannon.js, matter.js, PhysicsJS) and it seems that this is the common way ...
11
votes
2
answers
2k
views
Moving player inside of moving spaceship?
INTRO:
I am trying to achieve a spaceship that flies through space and the pilot can get out of their seat and walk around the ship and place physics objects in it while the ship is moving, rotating, ...
0
votes
0
answers
16
views
How can I pragmatically move a navmesh rigid body when changing scenes?
I have an object with both rigid body and NavMeshAgent attached Which I want to set to a new location on scene change, but there is something weird going on with it.
If I just try to set the position ...
1
vote
0
answers
53
views
walk/stick to a platofrm
I was wondering how to approach this idea using Godot , is there a built in way to make a KinematicBody2D or ...
0
votes
0
answers
67
views
Plot rigidbody path simulating magnus effect
I am trying to create a method that will plot the path a rigidbody will take when simulating a magnus type effect with no gravity in Unity. I realize this approach is a drastic simplification to the ...
1
vote
1
answer
61
views
Making interacting gears in 2D
I want to create mutually rotating gears for a puzzle game.
I looked at a lot of material, but didn't understand how to make a RigidBody2D stay in one place correctly and interact with each other.
...
0
votes
0
answers
33
views
I'm using a *Floating* Capsule Collider, but it keeps contacting floor especially if I fall at high speeds?
I have the below code for a "Floating Capsule" style Rigidbody controller. Based largely on a tutorial (https://www.patreon.com/posts/astro-kat-moving-21343562) although I've modified it a ...
0
votes
1
answer
76
views
Why do colliders have a tendency to spin and develop crazy angular velocity in Unity when used as my "player"?
I am trying to create a basic collider for a rigidbody player in Unity 3D. I have been experimenting with numerous shapes but found it hard to get what I want.
The primary issue seems to be if the ...
1
vote
1
answer
39
views
How do I apply real time physics to a 2D game in Java?
I'm developing a 2D Brick Breaker style game in Java and want to apply some real time physics to it, especially to the paddle/ball interections. Nothing too complex; just applying some of the physics ...
0
votes
0
answers
12
views
Unity3D object falling from high are passing through ground [duplicate]
First, you can see the bug in action here: https://www.youtube.com/watch?v=vqbo3rweEmA
When rigidbody objects are falling from high position (300 in my test), the ground collision doesn't works, the ...
1
vote
0
answers
100
views
No Collision while rotating. Object rotating with Rigidbody.Rotate passes through other collider
I'm working on a 3D game, and having issues with the colliders.
My Cube Controller has movement input by keyboard, with collider and rigidbody components.
Cylinder objects have basic colliders and ...
0
votes
0
answers
16
views
Is there a lighter way to implement "object stops when hit wall" without relying on Dynamic gameobjects in Unity3D (2D)?
I am currently using a Dynamic GameObject for my entities, but I feel as if that will risk slowing down the game on weaker hardware (especially when there are hundreds of entities). Not only that, but ...
1
vote
1
answer
119
views
How do I get OnTriggerStay2D to consistently work in Unity?
(2D Project)
I have a very basic set-up in which I have a Hallway with a door and a bunch of other objects. I have a player that starts on the left side of the hallway and only moves on the x-axis.
...
0
votes
0
answers
37
views
Using ProjectOnPlane to stick to slopes and avoid getting stuck on difficult terrain?
I have a simple Rigidbody movement script.
I am having difficulty getting the rigidbody to stick to slopes, and also to collide with difficult terrain without getting stuck.
I read that ProjectOnPlane ...
0
votes
1
answer
60
views
Why does my code intended to stop Rigidbody from sliding prevent player from jumping?
I have the following code which gives a Rigidbody capsule the ability to move and jump (if on layer Ground).
After Player stops input, the Rigidbody slides. I ...
1
vote
1
answer
63
views
How to make a code-generated mesh interact with a rigidbody?
I'm using a sphere and an empty game object that generates a mesh upon playing/starting.
On the mesh, I place a Mesh Collider component with ...
0
votes
0
answers
43
views
What causes Rigidbody character to suddenly move at fast speeds?
I'm trying to make a Rigidbody-based movement script for a character.
It behaves pretty much as expected, but every once in a while the character will suddenly run at a massive speed. I can't find a ...
0
votes
0
answers
32
views
High rigidbody drag value gives weird speed readings
when calculating speed in unity
...
0
votes
0
answers
32
views
How to change fall delay of a gameobject by time?
I want my gameobjects to fall faster by time as the player collides with them. What I mean is, when the game starts, the gameobjects fall off after 1 second the player collided with them, but after 60 ...
1
vote
0
answers
62
views
Maths behind Unity rigidbody.AddForce
I've tried to understand the Maths behind AddForce, as to reproduce it using rigidbody.velocity +=.
Based on the formulas ...
11
votes
1
answer
3k
views
How can I "zero out" velocity in an arbitrary direction?
I'm currently running into an issue with my character controller using physics-based movement of rigidbodies in Unity.
Here's an illustration of the issue I'm facing:
Basically, after a jump, my ...
0
votes
1
answer
57
views
How to knock animated character backward when sword strikes wall
I was wondering how to make animation and physics interact.
Specifically, I want to make it so when my character (rigidbody) plays a sword hit animation (swinging the sword in front of it), it makes ...
0
votes
1
answer
58
views
How do I use a ball as a wheel?
I'm brand new(ish) to Unity with a strong programming background. I understand the basics of "how to roll a ball" in Unity, but I have a custom model I made in Blender which I have imported ...
-1
votes
2
answers
116
views
Parent object does not rotate on its own axis with its children. How do I fix it?
My parent object components: Rigidbody2D and the script I shared below.
Children(Head, Body, Arm, Backpack...): There is only collider. There is no rigidbody2D. (I want the parent object to use the ...
1
vote
1
answer
270
views
Firearm magazine ejection
I am playing around with a VR game where the player can fire a hand gun. When the magazine is empty they can press a button on the controller to eject the magazine from the gun. As its VR, I would ...
1
vote
1
answer
41
views
Make a rigidbody walk around a planet
I have my character with a rigidbody and attracted by the planet. I am trying to move it with its velocity. I tried this script:
...
0
votes
1
answer
51
views
Why addForce creating some small movement in my game object?
I'm working in a project with Unity 2d where player walks on a small planet. I try to use some code from youtube tutorial to apply gravity to my planet.This code consists of two parts, Attractable and ...
3
votes
1
answer
102
views
Why my player can suddenly fly?
I'm working in a project with Unity 2d where player walks on a small planet. I try to use some code from youtube tutorial to apply gravity to my planet.This code consists of two parts, Attractable and ...
0
votes
0
answers
33
views
Why does Lerp not reach target if setting rb.position, but setting rb.transform.position works?
I don't understand the logic here.
I have the following script which makes a player jump towards a target:
...
1
vote
0
answers
46
views
Root Motion animation clipping through Rigidbody objects? (Unity 3D)
I am trying to program a climbing system. Player has rigidbody, ledge has rigidbody. Both also have Colliders, and the Player animator is set to use Root Motion.
When Player grabs ledge and climbs up ...
0
votes
0
answers
440
views
Sprite jitter on movement with pixel perfect camera and Cinemachine in Unity
I have been struggling to get rid of jittery sprites in my game. I've been pulling my hair out for past 4 weeks trying to fix this issue. So I cooked up a small show case project with my player that ...
-1
votes
3
answers
125
views
Object is not moving after collision
I have player and walls. When the player hits the wall, its not moving.
This is the code for moving:
...
0
votes
0
answers
95
views
Unity 3D - Grappling Gun not making Player lift off the ground at all?
I have the following code (based on https://www.youtube.com/watch?v=Xgh4v1w5DxU but tried to convert to work with world space points for Third Person Character usage):
...
1
vote
0
answers
181
views
With Unity, why this character with a rigid body and child element colliders doesn't collide with the floor and go through it?
I got an issue with my character going through the ground and actually going through all other elements with a collider. I'm going to try and show as much as I can of the current state of things.
My ...
1
vote
1
answer
28
views
Dynamic bridge via joints
When a new object is added to the bridge, the bridge shakes violently, and when objects are added even faster, it breaks.
I've tried changing mass and changing time step, but that doesn't solve the ...
0
votes
1
answer
73
views
Control does not work if motion is set in FixedUpdate
I made touch controls, but when I set forward movement, the control stops working.
...
0
votes
1
answer
82
views
add force to object that has 2 different rigid bodies
I need add force to object that has 2 different rigid bodies and someone said that the best way of this is using fixed joint. The case is this ; I have player object and it has a pusher object that ...
1
vote
0
answers
32
views
How to get a consistent behavior for a rigid body hooked platform?
Consider this platform made of RigidBody2D and PinJoint2D objects:
PinJoint2D setup is:
<...
1
vote
0
answers
94
views
How to make a catapult work with physics and colliders?
This should be my final question regarding getting a catapult to throw something in unity. On my last question, someone suggested starting with something simpler (which I apologize for not doing ...
0
votes
1
answer
146
views
add random force and direction to rigidbodies every x seconds
i need to add a windForce to multiple rigidbodies, with random direction and random force every x lapse of time. I'm using ...
-1
votes
2
answers
313
views
"Rotation Quaternions must be unit length" using rigidbody.MoveRotation in unity
I'm making a game that involves throwing things with catapults. The cup of a catapult needs to use Rigidbody.MoveRotation to let a ball respond to being thrown in ...
0
votes
1
answer
285
views
How to Get VR Controller's Velocity in Unity with SteamVR?
Back when I used Unity 2017 and controller bindings weren't a thing, I simply attached a rigidbody to my Vive controller and read out the velocity of the rigidbody to know how fast the player was ...
0
votes
1
answer
607
views
How do I adjust my rigidbody velocity on a local axes?
I have an fps rigid body script, code listed here:
...
0
votes
1
answer
362
views
Rotating fps rigid body on the Y axis
I'm currently attempting to make a first person character using a rigid body. I am aware that the character controller exists, but I believe my game will be very physics based so it's better if my ...
0
votes
4
answers
774
views
Sticking the Rigidbody2D player to a moving platform without parenting & transform fiddling
I have a player entity with Rigidbody2D component and I have a moving platform which is a kinematic Rigidbody2D. Player movement is done by setting it's velocity (...
0
votes
1
answer
254
views
Momentum-wise accurate player controls in Unity regarding collisions
First post here. So I am a newbie to Unity and am willing to create a general character controller script to base my future characters. I understand a character's mechanics are pretty design (UX) ...
0
votes
2
answers
74
views
How to make the snake bodyParts follow same places and directions as the player on a curved surface?
I try to make a game like the classic snake game but on a round ground (Earth). On a plane, the script works well, but when i moved it on a sphere, the bodyparts (prefabs), are not working good as you ...
0
votes
0
answers
65
views
Why does my character slide off of the platform if I'm using MovePosition, but not if I'm setting transform.position
I have a platform which consists of a box collider, a rigidbody2d and a script which moves the platform through waypoints.
I also have a Rigidbody2d character which can move around and jump.
One of ...
0
votes
1
answer
32
views
Applying velocity to parent that ignores children's mass not working
I am making a VR data visualisation app in Unity and I have a parent with many children (just some primitive cubes) that I can toss around the scene by just setting the parent's rigidbody to the same ...