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
Related
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...
So, I make a car using wheel colliders. Also I have a simple scene with a box collider. The problem is that when wheel colliders touch box collider, the car takes off in the sky and starts turning. What I'm doing wrong?This is how wheel colliders are tuned
I consider this was a very stupid mistake. I just turned off is Trigger for box collider of the scene, and all started to work well. I hope it will help someone)
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.
Instead walking on the ground he walk through it same for the ship and debris the other objects. He stay on the ground on the terrain but all the other objects in the scene he walk through it.
In the past i added Mesh Collider to the ship sapceship and checked the Convex turned the Convex on so it worked fine. but now i tried to add Mesh Collider almost to everything in the scene and it didn't change anything.
The scene is not my own but there is nothing speical i think. A terrain camera and objects. I added the ThirdPersonController.
Maybe there is a way to solve it making a new script in c# ? So far i could not find solution.
Make sure the collider of the Player is big enought to hold the model. And also that the terrain collider is adjusted to the terrain.
Try to change Center(Y) value of CapsulCollider
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.