0

I have two objects: a player and a wall. The player is passing through the long side of the wall but it collided with the short side of the wall.
I want the player to collide with whole wall.

enter image description here

Here is the code:

enter image description here

Pikalek
  • 12,372
  • 5
  • 43
  • 51
shriram
  • 11
  • 2
  • We need more details to be able to reproduce and help you solve this problem. How are you moving your player? (Show us the script) What kind of collider components are you using on the player and on the wall? How is the player's rigidbody configured? – DMGregory May 18 '21 at 11:22
  • 2
  • Code should always be shared as properly-formatted text, not as an image. See the [help] if you need support with the formatting. 2) Rigidbodies should be moved with the rigidbody component, not the transform. We've covered this in past Q&A.
  • – DMGregory May 18 '21 at 14:36