K
kylecruffin
Guest
This boxing glove ship is meant to bounce away and take damage on collision with the ball. However, it seems to bounce away before it even gets close.
Here are the physics colliders I've set. I don't understand why these seem to behave as though they're colliding before these should overlap.
Here's what the boxing glove has in the "collision with ball" event:
Excuse the messiness, this was converted fairly hastily from GMS1 and I haven't gotten around to cleaning up all of the variables named __b__ and such. Regardless, none of that should be relevant, since the collision itself is the issue. I suspect physics_test_overlap is redundant since it's in the collision event, but I was hoping it would fix this issue. It doesn't seem to.
I've checked the masks, and that doesn't seem to be the issue either. This is in a physics room, and both objects have a fixture, as evidenced by the physics collision shapes.
Any ideas on what might be going wrong? I'm very stuck.
Here are the physics colliders I've set. I don't understand why these seem to behave as though they're colliding before these should overlap.
Here's what the boxing glove has in the "collision with ball" event:
Code:
if(physics_test_overlap(phy_position_x,phy_position_y,phy_rotation,obj_exploder))
{
action_set_relative(0);
charging = false;
var length = sqrt(power(other.x-x, 2) + power(other.y-y, 2));
var xNormalized = (other.x-x)/length;
var yNormalized = (other.y-y)/length;
physics_apply_impulse(x, y, -xNormalized * 250, -yNormalized * 250);
{
action_set_relative(1);
action_set_health(-10);
action_set_relative(0);
}
var __b__;
__b__ = action_if_variable(image_speed, 1, 0);
if !__b__
{
{
action_sprite_set(Player, 0, 1);
action_set_alarm(invincibleTime, 0);
__b__ = action_if_health(1, 1);
if __b__
{
{
dead = true;
}
}
}
}
action_set_relative(0);
}
I've checked the masks, and that doesn't seem to be the issue either. This is in a physics room, and both objects have a fixture, as evidenced by the physics collision shapes.
Any ideas on what might be going wrong? I'm very stuck.
Attachments
-
366.9 KB Views: 4