S
Seebo
Guest
Hello! I'm trying to make a game using physics. I have a cannon (obj_Cannon) which shoots balls (obj_Ball). The cannon has a small animation after which the ball is being shot. So I put this code into Animation End event of obj_Cannon:
It works, but if I try to change yimpulse_local to -200 or -500 or -1000 nothing changes. The impulse becomes less powerful if I write numbers between 0 and -100, but it seems that the impulse stops at 100 and doesn't become stronger.
I also disabled gravity and wrote phy_speed_y += 0.3 inside obj_Ball's Step event, maybe this has some influence on my problem.
I also found out that if I set room_speed to 60 (it was 30) the impulse could increase up to -150 but than again stops. Since room_speed is higher, my improvised gravity is stronger too. So this -150 just shoots the ball at the same level as it was at -100 with room_speed = 30. Now I think that maybe problem is not in impulse and something just limits the speed of obj_Ball.
What is wrong and how can I fix it?
Code:
with (instance_create(x, y, obj_Ball))
{
physics_apply_local_impulse(0, 0, 0, -100);
}
I also disabled gravity and wrote phy_speed_y += 0.3 inside obj_Ball's Step event, maybe this has some influence on my problem.
I also found out that if I set room_speed to 60 (it was 30) the impulse could increase up to -150 but than again stops. Since room_speed is higher, my improvised gravity is stronger too. So this -150 just shoots the ball at the same level as it was at -100 with room_speed = 30. Now I think that maybe problem is not in impulse and something just limits the speed of obj_Ball.
What is wrong and how can I fix it?