P
PieBaron
Guest
I'm trying to program a physics projectile which gets its velocity based on the orientation of the object which created it, but I since I have more than one object which can create this projectile I can't just address it by name..
// I can create the right velocity data
fGx = dcos(image_angle-90)* abs(fooVel);
fGy = dsin(image_angle-90)* -abs(fooVel);
projectile = instance_create(xOff,yOff, obj_projectile)
with(projectile){
physics_apply_force(phy_com_x, phy_com_y, fGx, fGy)
}
// But I don't know how to pass the fGx and fGy to the projectile object..
// I can create the right velocity data
fGx = dcos(image_angle-90)* abs(fooVel);
fGy = dsin(image_angle-90)* -abs(fooVel);
projectile = instance_create(xOff,yOff, obj_projectile)
with(projectile){
physics_apply_force(phy_com_x, phy_com_y, fGx, fGy)
}
// But I don't know how to pass the fGx and fGy to the projectile object..