• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Placing object by distance and angle, rather than x and y?

R

Rosieu

Guest
Hi everyone!

Strange query I'm afraid, and it could just be me not seeing the whole picture!

I was wondering if anyone knew of a way to control the placement of an object using the angel and distance between two objects, rather than x and y?

Conventionally I'd call something like
"instance_create(x,y,object)"

but what I'd love to be able to do in this case is achieve (though I know this code is incorrect)

"instance_create(40px from object, at 60 deg. angle, object)" etc, etc

Apologies for the atrocious pseudo-code, but hopefully you'll see what I mean!

Any help is greatly appreciated!
 
R

Rosieu

Guest
Hahaha wow! It's times like this I realise just how green at this I am!

Thanks so much, you're an absolute lifesaver! :D
 
Top