Carloskhard
Member
In other words, I have a code that moves a certain phy_object in circles (around a planet, so Angle and position are changing). The code works for attaching objects to planets and it is the following(Feel free to use it):
The problem is that if I do that, when my ship lands on that phy_object;which is a platform to land; it doesn´t generate friction and it slips like ice-skating, because the platform is not technically moving, but teleporting.
So, I was wondering if I could somehow make the platform move exactly the same but updating phy speeds so the ship gets pulled together with the platform because of friction.
The game I'm implementing this on is the one on my signature and you can see a gif of what I mean here:
As you can see, when landed on the planet the friction works perfectly since the planet is moving with phy_angular_velocity, but the platform don't.
Thanks for the help!
/// @description attach_to_planet(parent_attached,pos_ang,dist);
/// @param parent_attached
/// @param pos_ang
/// @param dist
//run inside the object wich is attached to the planet
var dist,attach,pos_ang;
attach = argument[0];
pos_ang = argument[1];
if (argument_count>2)dist = argument[2]
else dist = attach.radioDist;
if(attach.liquid_planet)dist +=50;
phy_position_x = attach.x + lengthdir_x(dist,pos_ang+attach.image_angle);
phy_position_y = attach.y + lengthdir_y(dist,pos_ang+attach.image_angle);
angle = point_direction (x,y,attach.x,attach.y);
phy_rotation = -angle -90;
/// @param parent_attached
/// @param pos_ang
/// @param dist
//run inside the object wich is attached to the planet
var dist,attach,pos_ang;
attach = argument[0];
pos_ang = argument[1];
if (argument_count>2)dist = argument[2]
else dist = attach.radioDist;
if(attach.liquid_planet)dist +=50;
phy_position_x = attach.x + lengthdir_x(dist,pos_ang+attach.image_angle);
phy_position_y = attach.y + lengthdir_y(dist,pos_ang+attach.image_angle);
angle = point_direction (x,y,attach.x,attach.y);
phy_rotation = -angle -90;
The problem is that if I do that, when my ship lands on that phy_object;which is a platform to land; it doesn´t generate friction and it slips like ice-skating, because the platform is not technically moving, but teleporting.
So, I was wondering if I could somehow make the platform move exactly the same but updating phy speeds so the ship gets pulled together with the platform because of friction.
The game I'm implementing this on is the one on my signature and you can see a gif of what I mean here:
As you can see, when landed on the planet the friction works perfectly since the planet is moving with phy_angular_velocity, but the platform don't.
Thanks for the help!