Unity rigidbody always falling when on another rigidbody. (Unity 2D) - unity3d

I'm relatively new to Unity, I have a player character and a box sprite, I want the box to be movable by the player and for it to fall, so I gave the box a box collider 2D and a rigidbody2D, the box moves fine and the player can move it OK, however whenever the player is touching the box in any way (standing on it or pushing it) the characters Y velocity begins fluctuating uncontrollably making it play the falling animation. Through some testing I found the problem was the player's rigidbody and boxes rigidbody interaction, I don't know how to fix it. Any help would be great thanks

I think u just need to set both the player character and box sprite 's rigidbody2D to dynamic with 1 gravity scale... u can change their mass to manipulate the motion...

Related

Preventing collider from glitching through terrain

I'm using a terrain in Unity 2019.2.1f1 and a custom mesh of a cave with a mesh collider.
My character that has a Capsule Collider way bigger than the entry of the cave should not be able to enter in. But due to the roundness of both colliders, he can come into force in the cave, glitching through the terrain collider.
I think it's velocity is not excessive, I'm moving the character with rb.MovePosition() in the FixedUpdate(), and I set its rigidbody collision detection to Continuous speculative (tried all the "continuous" modes)
In the animation below, you can see the mesh of the cave and the capsule collider around the character.
How can I prevent this from happening? How can I say to Unity: "I want the colliders to be rock solid and not marshmallow"?
Colliders in Unity are rock-solid. They are incapable of any kind of soft physics, and the only moment they will warp through each other is when you force them to.
Here, you are setting the rigidBody position by force, into an impossible location. The game tries its best to fit your rigidBody despite the lack of room.
You can
Only use forces, and velocities. You can simply set the velocity to the direction of your choosing, and set it to 0 when you stop moving, or use AddForce, which is basically the same thing.
Keep using MovePosition, but use a SphereCast or CapsuleCast to check if you have enough room to move first.

Need to stop SteamVR camera seeing through walls

I am using player prefab from SteamVR Plugin. Whenever player touches an object with a Collider on it, camera sees through it. I am using 0.01 as minimum clipping value. I have also added Rigidbody and Collider on camera.
I also do not have code currently but here’s a concept of how to approach the problem:
Keep a trigger collider on the camera.
Write a script that detects when that collider is within another collider (your walls). There is a method for checking if colliders are intersecting/overlapping
If there is an intersect/overlap, fade the camera to black. If there is not, fade back.

Capsule Collider doesn't move smoothly

I have some issues using CapsuleCollider and RigidBodyController in a Player GameObject in Unity.
Using a CapsuleCollider as collider for the player, I noticed that the player doesn't move like a capsule or a sphere (in other words, I want that the movement should be like a rolling ball, with no stuttering), but its movements like more like a box pushed, with stops and starts, that make some little oscillations of the camera.
Any ideas, solutions or tips?
realy that is all based on how your moving the object, and the rigidbody2D settings of the object, I think using physics forces would roll your character like a ball or capsule, however just setting a velocity wont.

Objects not colliding in 2D project

I've set up a 2D project in Unity (4.3.4). It has a ball and ground. The ball is in the air.
To the ball I've added Box Collider 2D and Rigidbody 2D, standard values.
To the ground I've added Box Collider 2D.
When I run the game, the ball falls, but instead of stopping when hitting the ground, it continues and keep falling.
Where did I go wrong? By the tutorials this should simply work?
Check if one of the two colliders has the checkbox isTrigger checked. They should both be unchecked for collisions to work. First time that happened to me it took me a whole day to figure it out xD

Collisions issues of CharaterController with other box colliders

I have a Player with a CharacterCollider & Coins with box collider. When my player collides with coin, then i m disabling coin in OnControllerCollideHit() with hit.gameObject.active = false (where hit = coin gameObject).
But still i m getting some back force or a kind of jerk when i collide with coin.
How can i remove that jerk or force on player collision with any coin box collider.?
I did a lot of research on Google & some forums, but can't find related to this issue.
Any Code will be appreciated.
Thankx
I resolved this issue with a trick.
I added an empty child GameObject with Box collider & Rigidbody in my Player GameObject & increase the collider area that cover my player collider.
This will make me to react before i collide with player collider. And i m handling Coin collision & other collision with empty GameObject collider.
I think this solution might probably help other people on Here. Gud Luck.
If you Don't use Trigger, I suggest check on trigger on Box collider in your Player Object. then OnTriggerEnter function will called when collide with coin.