I want to add the ability for the player to pick up boxes and move them around, but when the player picks up a box and touches a wall, it starts to twitch and go through it.
Please tell me how this can be fixed. I'm at a dead end.
Here is a video displaying my problem: https://youtu.be/TGt73ASBYpQ
Some code:
//The point at which an box is attracted
attractedTo = player.transform.position + (player.lookDirection * player.itemHoldDistance);
//Attraction
transform.position += attractedTo - transform.position;
P.S. Sorry for my bad English