首页 > 解决方案 > 如何在游戏制作者 2 中从枪管中发射子弹 [已解决]

问题描述

当我用偏移射击子弹时(当射击子弹时,即使我说它向上瞄准,子弹也会像枪一样向前产生)

枪原点

偏移量不会将枪支旋转计入帐户。

问题视频:https ://imgur.com/a/N3UxVHw 。

这是枪/射击代码:

x = oPlayer.x + 30;
y = oPlayer.y;

image_angle=point_direction(x,y,mouse_x,mouse_y);

firerate -= 1;
if mouse_check_button_pressed(mb_left)
{
    with(instance_create_layer(x + lengthdir_x(50,image_angle) ,y ,"Bullets",oBullet))
    {
        speed = 20;
        direction = other.image_angle;
        image_angle = direction;
    }

}         

提前致谢!

[解决方案]

编辑:经过 3 个多小时的搜索,我找到了解决方案:

在枪管上产生子弹

标签: game-developmentgame-maker-studio-2

解决方案


推荐阅读