- Home /
Is there any way to disable the reaction forces applied on a rigid body when it collides with another moving rigid body?
I have a cube which keeps sliding(until it hits a wall or something) along the tile surface when it collides with another moving rigid body cube. The problem I think is due to the reaction forces upon collision.I thought of getting past this unwanted sliding by switching the isKinematic variable to true in the OnCollisionEnter2D() function but then,I still want to use the rigid body component properties like gravity and mass. Is there any way to make this happen? Is there any way to disable the reaction forces applied on a rigid body when it collides with another moving rigid body?
Answer by xxmariofer · Aug 05, 2020 at 07:33 AM
simply mark them as trigger so they will pass through
Answer by CodesCove · Aug 05, 2020 at 07:33 AM
You can use also Layer Collision Matrix to do that (Edit - Project Settings - Physics - Layer Collision Matrix). So create layers for your objects and disable collisions from the matrix between those layers.
I don't see how it is different from isTrigger. I do want to collide my player with other rigid bodies but do not want to get affected by their velocities.
sorry but your statement makes no sense, if you dont want to get affected by their velocities you simply dont want to have collisions at all, a collision without forces can not exist, what do you want to happen when the object collides if they are not affected by velocities?
I mean when I move my player and it collides with a pendulum bob, the pendulum swings as I want but in return ,because the pendulum is about 10 times heavier than the player object, it pushes the player back with a small impulse force.So, when I land, it keeps sliding in that direction of impulse until I press my movement keys. I wanted to know if something could be done to do away with that reaction impulse?
Your answer
Follow this Question
Related Questions
Rigidbody2D.isKinematic = true and parenting unresponsive 1 Answer
Problem with a RigidBody and IsKinematic... I think 1 Answer
Rigidbody2D isKinematic effect by growing mass to huge number ? 0 Answers
How to set .isKinematic=false; on object in a script that is not attached to the object 1 Answer
mesh colliders problem 1 Answer