Legacy GM How to boost a physic object speed in "place_meeting"?

B

Bhreno

Guest
objects:
obj_ball;
obj_impulseblock;

my obj_ball, when contacting an obj_impulseblock, will get a boost in a direction that obj_impulseblock is pointing in her sprite_index. So far so good.
However, the obj_impulseblock is neither physical nor solid (while the obj_ball is physical!), It exists only to give a boost to the obj_ball if it enters "inside" it (place_meeting), but no "collision" should occur between the two.
The problem is that even if the obj_impulseblock is neither solid nor physical, it ends up colliding with obj_ball before her "enters", and she is diverted (when in reality it should get the boost).

Example:
If the velocity of the obj_ball to left is 3 or less (phy_speed_x <= 3), when her it "passes" through the obj_impulseblock and its sprite_index is "spr_impulseblock_left", her will get a +2 impulse to the left speed.
 

Bart

WiseBart
place_meeting is used with the normal collision system, not with the built-in physics.
From how you describe it, it seems like you can make use of sensor fixtures for obj_impulseblock.
There is no actual collision with such fixtures (i.e. they're not solid) but the collision event is triggered. There you can modify the instance's speed by applying a force or an impulse.
 
Last edited:
Top