Director_X
Member
HI.
Running into a bit of a problem. I need my physics object to move towards the mouse, and set its speed when I right-click.
Problem with the physics in GM is that the speed is set on the Axis, and not an actual speed setting.
So if for example, I set the following:
phy_speed_x = 10;
phy_speed_y = 10;
It will change BOTH the speed, and the ANGLE (or is it x,y coordinates?) of X and Y by 10 degrees!!
So how do I change just the speed, without changing ANY angles???!
Please help.
Thanks.
Running into a bit of a problem. I need my physics object to move towards the mouse, and set its speed when I right-click.
Code:
// Currently this whooshes towards the mouse pointer quite fast.
physics_apply_impulse(x, y, -(x-mouse_x), -(y-mouse_y));
//I need to set it's speed.
phy_speed_x = ??;
phy_speed_y = ??;
So if for example, I set the following:
phy_speed_x = 10;
phy_speed_y = 10;
It will change BOTH the speed, and the ANGLE (or is it x,y coordinates?) of X and Y by 10 degrees!!
So how do I change just the speed, without changing ANY angles???!
Please help.
Thanks.
Last edited: