I want to create an invisible barrier that my player will just bump into if it collides into it. I followed this thread to create my barrier invisible walls - Questions & Answers - Unity Discussions. It works pretty well for the most part except for the fact that if I keep bumping into the wall, the player can go right through it. How would I fix this?
First thing to check if do all your invisible barrier have Colliders on them? Are the Collider’s “Is Triggers” box clicked on?
Second thing If you have a Rigidbody and all the proper Colliders and you’re not ignoring the collisions via code or anything like that… Try setting your Rigidbody’s Collision Detection to “Continuous”.
Discrete Detection: Checks the next frame “Is the collider touching another collider in this frame? If not, move there, if so, we collided”
Continuous Detection: Fires a Raycast in the direction of movement to check the collision before they happen.
And Third is please post your code in the reply section so i can help you with the code . Cause maybe it is your problem
Rigidbody > collision detection > continuous