You are not logged in.
Pages: 1
I already submitted, but this can help now already if you want to know how to easily rotate object to look towards other objects in the physics world of GMS, since direction and image_angle doesnt work anymore.
Very handy for homing missiles, or space ships following other ships, etc.
//phy_look_at(target);
//This script will make physical object rotate always to look at another target object in physics world
//script should be in STEP event
//returns = noone
{
var target, dir;
target = argument0;
if instance_exists(target) {
dir = point_direction(x,y,target.x, target.y);
}
else {
exit;
}
phy_rotation = -(dir-90);
}
Last edited by Boysano (2012-11-23 15:53:36)
Offline
Good. You should add a script that does the reverse and perhaps a versions that takes angle as argument gm_angle_to_phy_rotation(gmangle)
phy_rotation_to_gm_angle(phyrot)
Offline
Pages: 1