How to restrict for a player movement? Player can go thru the wall.

I have player with next properties:

Player move code fragment:

if (isMoveLeft)
			var angle = transform.eulerAngles.z+this.turnSpeed ;
			float yAngle = Mathf.LerpAngle(transform.eulerAngles.z, angle, this.rigidbody.velocity.magnitude * Time.deltaTime );
			var rotation = Quaternion.Euler( 0, transform.eulerAngles.y,yAngle );
    		rigidbody.MoveRotation( rotation);

		this.rigidbody.velocity = this.transform.up * flyingSpeed* Time.deltaTime; 

And I have ‘wall’ (With box collider and physic material)

‘bounciness’ 1,

‘static friction’ 100

I cannot go thru the wall instantly - collider is working!
But if I will move in that direction for a few seconds player will go thru.

What i am doing wrong?

I want my wall to stops player and that’s it.

Something like this doesnot helps:

	void OnCollisionEnter(Collision collision) {

I think the player has to be a trigger so OnCollisionEnter is called.

But you should not need this method. I am not sure but i think if you would make the player move using physical forces the colliders would react and he would be stopped by the wall. Without the callback beeing called or used.