Questions tagged [rigidbody]
In game development, a rigidbody is usually referred to anything that is affected by physics.
311 questions
0
votes
2
answers
105
views
When should an object with a collider have a rigidbody?
I had some questions about Physics / Rigidbody in Unity.
I have a 2D sprite with a collider. The 2D sprite is simply a card that I place on a table with the mouse. I use the collider for raycasting (...
0
votes
1
answer
110
views
OnTriggerEnter called without a Rigidbody
I use Unity and the player controller in the game is acting strangely. It has a Character Controller but no Rigidbody. I use CharacterController.Move to make him ...
0
votes
1
answer
224
views
3D Dark Souls lock-on code: Player moves around target in a spiral, not perfect circle
I'm working on a 3D game in Unity that requires lock-on, or Z, targeting found in games like Dark Souls and Legend of Zelda: Ocarina of Time.
The code that I have achieves my intended goals fairly ...
2
votes
1
answer
198
views
Character Keeps Entering and Exiting Trigger on Moving Platform in Unity
I'm developing a character controller in Unity and running into a problem with my character repeatedly entering and exiting a trigger collider on a moving platform. The character should stay within ...
1
vote
3
answers
1k
views
How to add a local gravity/force field in Godot?
I am trying to develop something in Godot and I was hoping it would be possible to create some sort of gravity field. I do not mean just the default falling down indefinitely. I mean like a kind of ...
0
votes
0
answers
89
views
Collision detection with CapsuleCast
I'm attempting to detect when a gameObject with a Capsule Collider and RigidBody attached it lands on the floor, which is a Mesh with a Mesh Collider attached it to it. Adding a tag to the Floor ...
0
votes
0
answers
60
views
In Unity, how can I check whether two objects are sliding on each other or rolling against one another?
I'm coding a script to make objects emit appropriate noises on contact with other objects, with different sounds for isolated impacts, sliding, and rolling.
Impacts work just fine, but for the other ...
2
votes
1
answer
200
views
Rigidbody Simulated vs Static vs none
I am confused about the usage of static / not simulated rigidbodies.
I get that it is better to disable simulated to temporarily stop a rigidbody rather than deleting and recreating it, especially ...
0
votes
1
answer
139
views
Why is my player not colliding with animated obstacles?
I can't figure this out. My obstacles have a basic box collider on them and my player has a rigidbody based controller and collsion detection is set to Continous and when obstacle hits him it just ...
0
votes
1
answer
78
views
How do I move both the child & parent game objects at the same time?
My current code is:
...
0
votes
1
answer
163
views
AddExplosionForce in 2D
Its a pretty simple question. I have a gun that shoots bullets, to make the game more fun i want the bullets to be used to navigate. For example shooting them below you would make the player jump up. ...
0
votes
2
answers
155
views
Why is my enemy not moving?
I'm trying to make a 2D Unity platform game for a school project, but I can't seem to get the enemy to move.
...
6
votes
1
answer
1k
views
How to get consistent collision impulse values for colliding rigid bodies in Godot?
I'm writing a game where you can pick and throw objects and depending on the force of the impact they break.
Using the get_contact_impulse method to calculate the breaking point gives me very ...
1
vote
1
answer
642
views
Rigid bodies sliding off slopes
Kinematic bodies have a simple class that makes the player not slide on slopes, but for rigid bodies? I tried using rays and areas, either to lock the player on an axis or to just straight up disable ...
1
vote
1
answer
422
views
How to prevent colliders from knocking each other back before being destroyed?
For context, I have a player that can use a bow or a spear to shoot enemies in a 2D side scroller game. The bow shoots arrows and the spear shoots itself, and they both have rigidbody2Ds attached.
...
0
votes
1
answer
237
views
how to rotate my character along the y axis when character is aligned with a slope
I have a capulse character Im moving around in my 3d Game, I usually rotate the character using this line of code:
...
0
votes
1
answer
216
views
Switching a velocity from one rigid body to another in unity
I have a set up where the ground and the player move with physics and a stationary camera.
I want the ground to move faster when the player is getting further away making it look that the player is ...
0
votes
0
answers
193
views
How to move a Rigidbody2D to exactly match the movements of another body?
I'm recording the velocity of a Rigidbody2D using Animation Curves and I need to reproduce the same "movement" on an instantiated prefab (we really need "stuck like glue" movement ...
0
votes
0
answers
310
views
Why doesn't jumping work if character is on upwards slope and moving forward?
I am having an issue where when I hit space to jump, the jump will only work (as in, launch player straight up into the air) only if I am (1) on flat ground (moving or standing still), (2) on a ...
2
votes
0
answers
103
views
How to connect particles to rigid bodies in LiquidFun?
In vanilla Box2D various types of Joints can be used to connect two rigid bodies together. The LiquidFun extension brings the Particle Module, but I was unable to find a way to connect a particle/...
0
votes
0
answers
596
views
Kinematic Rigidbody parented to a moving Rigidbody gets displaced
I have a kinematic Rigidbody parented to another non-kinematic moving Rigidbody. Render-wise, the child Rigidbody does not jitter, nor does it inherit any displacement changes from the parent ...
0
votes
0
answers
98
views
Motion of a cube after it bounces off a floor
I am trying to simulate what happens when a cube hits the floor after free fall. I am considering a situation in which cube hits the floor with its edge. There is obviously reaction force from the ...
0
votes
1
answer
95
views
Why is my simple movement script making Capsule go into the air when movement is fast?
I am trying to create a simple movement script. Currently I don't have any jumping implemented; the movement script should just move rigidbody-based Capsule left, right, forward, backward based on ...
0
votes
0
answers
72
views
Different approaches to rigid-body movement
I'm a beginner at game development and I'm building my own physics game engine to grasp the concepts.
I wonder if there are different approaches to moving and rotating a rigid body. For example, ...
0
votes
1
answer
169
views
How to move on vertical wall with gravity ticked for rigidbody
I am making a ball-rolling game. I want to implement an interaction where the ball can move on a specific area of a vertical wall like the game that the images show, but I don't know how to implement ...