c# public override void _PhysicsProcess(double delta) { if (DetectCollision(Player, Floor)) { Player.position } }
c#return ( a.minX <= b.maxX && a.maxX >= b.minX && a.minY <= b.maxY && a.maxY >= b.minY && a.minZ <= b.maxZ && a.maxZ >= b.minZ );
function checkCollision(a, b) --With locals it's common usage to use underscores instead of camelCasing local a_left = a.x local a_right = a.x + a.width local a_top = a.y local a_bottom = a.y + a.height local b_left = b.x local b_right = b.x + b.width local b_top = b.y local b_bottom = b.y + b.height --Directly return this boolean value without using if-statement return a_right > b_left and a_left < b_right and a_bottom > b_top and a_top < b_bottomend