ive been using gm 3d for over a year now and i have a problem that i cant seem to fix and i have tried a lot of things and even looked through most of the 3d forums and tried it all out but nothing works. the problem is when the 3d model of a gun goes through the wall or other model and i know it is a common problem but nothing works for me.
i think it may be due to my draw codes:
my code for my player draw event is
{
{
if ads > 5
{
d3d_set_projection_ext(x,y,z+player_height,x+cos(direction*pi/180),y-sin(direction*pi/180),z-sin(pitch*pi/180)+player_height+v_jump,0,0,1,45-ads_zoom-plus_zoom,1.33,1,1100)
}
else
{
d3d_set_projection_ext(x,y,z+player_height,x+cos(direction*pi/180),y-sin(direction*pi/180),z-sin(pitch*pi/180)+player_height,0,0,1,45,1.33,1,1100)
}
}
}and for my gun(separate object)
{
d3d_transform_set_identity();
d3d_transform_add_rotation_y((-obj_player.pitch_2+obj_player.stop_z_move)-(recoil*0.75))
d3d_transform_add_rotation_z(obj_player.direction);
d3d_transform_add_rotation_x(obj_player.x_rotation)
d3d_transform_add_scaling(0.5,0.5,0.5)
d3d_set_depth(-999)
d3d_transform_add_translation(obj_player.x,obj_player.y,obj_player.z+obj_player.player_height-obj_player.gun_height+obj_player.prone_height);
d3d_model_draw(global.model_gun_g3,9+recoil-obj_player.aim_move,(obj_player.x_move+obj_player.stop_x_move),-obj_player.aim_rise,background_get_texture(texture_gun_g3));
d3d_model_draw(global.model_gun_g3_slide,9+recoil+slide_move-obj_player.aim_move,(obj_player.x_move+obj_player.stop_x_move),-obj_player.aim_rise,background_get_texture(texture_gun_g3));
d3d_model_draw(global.model_gun_g3_magazine,9+recoil-obj_player.aim_move,(obj_player.x_move+obj_player.stop_x_move),-obj_player.aim_rise,background_get_texture(texture_gun_g3));
{
(other models are drawn here but to many to put on this )
}
}
if anyone knows a proper fix for this please share.
i know some people are probably going to say to use the search but before you do, i have many times.
thanks in advance
Edited by whiteshadow, 20 October 2011 - 10:59 AM.











