phy_bullet

Tells the physics engine that this object is a bullet.

Syntax:

GML Code Example

phy_bullet;


Returns: Boolean


Description

This variable defines whether or not the instance is extremely fast moving (for example a bullet). The default value is false but if set to true this tells GameMaker: Studio that the instance will be moving at such high speeds that it will require more expensive collision detection to ensure it doesn't pass through other instances undetected.


Example:

GML Code Example

with (instance_create(x, y, obj_Shoot))
    {
    phy_bullet = true;
    physics_apply_local_impulse(0, 10, 0, 200);
    }
 

The above code creates a new instance and then defines it as being a "bullet" in the physics world before giving it a massive impulse along the y axis.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here