I’m making a 2.5 D action game and i want my player to be able to push desks to use as barricades. My desks have joints so that I can fake destructible objects. I want my player to be able to attach to the desk from one side and be able to push or pull. How can i accomplish this? No scripts needed just show me links or tell me what to do thanks!!
Use OnCollisionStay. Check if the contact point is left or right of the player. If contact.x-position.x > 0 it is to the right. If it is <0, it is to the left. Also add some conditions on y to make sure it is at pushing height. If the player is moving in the same direction, add a force to assist with the push. If a button is also being pressed (for holding) and the player is moving away, translate the object with the player.
During the pushing, you could temporarily change the joint variables. Disable it, or set the break force and torque to infinity. Then change it back when you lose contact.