Moving Wall

So, the problem I am having is a wall is moving, and it should push the player if the player contact it. So far my script works if I am moving, if I hold the d key while moving towards the wall, the wall will move my player backwards. If I am staying still nothing happens. The wall doesn’t effect the player making the player go inside the wall. I am assuming that it is because in order to have a collision you must have a kinematic object hit a collider or trigger. I am confused and saddened. If anyone has a suggestion let me know. Currently I am using the solution in the 2d platform tutorial, and it works, just not if I am standing still.

Hello there!

This is most likely caused by the fact that your player’s rigidbody goes to sleep if inactive too long.
If that is indeed the problem you can solve it by inserting the following code at the top of your FixedUpdate() function:

rigidbody.WakeUp();