Finished the Collision detection part.

The way this Collision detection code works:

First, the player location (XYZ) is compared to the object position (XYZ) to see if the player is behind the object, in front of the object, left of the object, right of the object, above the object or below the object. Lets for example sake imagine that the player is behind the object, or that the object is in front of the player.

Secondly, we create an invisible mathematical collision plane. We do this by taking the Z coordinate and then subtracting a radius. We subtract the radius because the object is in front of the player ( - Radius on the Z axis ).

Thirdly, we set some bounds. The collision plane on the Z axis spans on the entire X and Y axis and we don't want that so we have to set some bounds. We only want to detect a hit in front of the collision plane. Since we're colliding against a plane on the Z axis, we have to check if the players X and Y are within range of the width and height of the object. 

It works like this, IF the players X is bigger than the objects X - the radius AND if the players X is smaller than the object X + radius THEN the player is within the bounds of X. 

When colliding on the Z plane, we check bounds on X and Y. When we collide on the X plane we check for bounds on the Z and Y, and when we collide on the Y plane we check for X and Z bounds.

At last we add the collision logic. IF player Z == Collision Z THEN player Z = Collision Z, effectively stopping movement in that direction.

This way there's always only one collision plane per object since it's created after determining the relative position to the object.