# Making an object move towards where it is facing

### » Tue May 06, 2008 11:12 pm

I'm trying to make a physics based spacecraft movement but I can't seem to figure out how to thrust the "spaceship" towards (or away from) the direction it is facing. Right now, it is just moving straight up or down rather than the direction the ship is rotated towards. I tried to use coodinate of bottom edge and top edge, but that didn't work. I tried to add detectors and add force to those but that did nothing. Argh, I seem to be missing something, something very simple, yet I can't figure it out.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

### » Tue May 06, 2008 11:34 pm

+ Key W is down
> Add force 10 * cos(.angle), 10 * sin(.angle)

+ Key S is down
> Add force 10 * cos(.angle+180), 10 * sin(.angle+180)
Scirra Founder
B
414
S
245
G
92
Posts: 25,205
Reputation: 200,351

### » Tue May 06, 2008 11:38 pm

Ah, it was math related. I wish Math wasn't my weak point. No wonder I was stumped. Thank you so much, Ashley. I guess I really need to brush up on my Math skills, heh.
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

### » Wed May 21, 2008 9:30 pm

I made a movement like that! Instead of my math skills i used my very well developed work-around skills! I gave the spaceship an image point in the front, and added force towards that point of itself!

Have a look in the .cap! you might find other useful things!

viewtopic.php?f=4&t=738
B
10
S
2
G
5
Posts: 746
Reputation: 3,342