• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Falling through map in 3D game with jump code. Need help!

S

shaan150

Guest
Hey guys. Right let me get straight to the point basically in my game it was working fine until i added a jump code.
Here's my code to create my floor:

Code:
  var rep = 1;
    
    
    grass = d3d_model_create();
    d3d_model_floor(grass,-32000,32000,0,32000,-32000,0,rep,rep);
    
    ground_tex = background_get_texture(tex_ground1);
Here's my code for my jumping:

Code:
 grav += 0.75;
    z -= grav/1.5;
  
      if place_meeting(x,y,grass)
      {
    
        if z < instance_nearest(x,y,grass).z + grav
        {
      
         if z > instance_nearest(x,y,grass).z - grav
         {
        
          z = instance_nearest(x,y,grass).z
          grav = 0;

        
         }
        
        }
    
      }
    
    
    
        if(keyboard_check_pressed(vk_space))
        {
      
         if grav = 0{ grav = -30;}
        
        }
I might include as well my floor is invisible after adding this code plus i fall through it.
I have attempted to search online for answers but i have been unable to find any.
Any help is useful. If need be i can provide screenshots of my game.
 
Top