Discuss Scratch

AstroDeci
Scratcher
34 posts

Not Turning at Desired Position

I am making a projectwhere a spaceship orbits different bodies (the earth, the moon and the sun), but the ship won't turn at the x positions I set it to.

“I have noticed even people who claim everything is predetermined, and that we can do nothing to change it, look before they cross the road.”
“I am pleased a book on science competes with the memoirs of pop stars. Maybe there is some hope for the human race.”
“My goal is simple. It is a complete understanding of the Universe, why it is as it is and why it exists at all.”
“I want to know why the Universe exists, why there is something greater than nothing.”
“No one can resist the idea of a crippled genius.”
-Stephen Hawking (all)
scubajerry
Scratcher
1000+ posts

Not Turning at Desired Position

You are using = in your comparisons. When you are moving at a direction other than 0,90,-90,180 the values of X and Y won't be exactly 100. It might be 100.003002. Therefore your comparison doesn't match. You can either use the ROUND function to change it back to whole numbers, or in your case, change your = to <
AstroDeci
Scratcher
34 posts

Not Turning at Desired Position

scubajerry wrote:

You are using = in your comparisons. When you are moving at a direction other than 0,90,-90,180 the values of X and Y won't be exactly 100. It might be 100.003002. Therefore your comparison doesn't match. You can either use the ROUND function to change it back to whole numbers, or in your case, change your = to <
Thanks!

“I have noticed even people who claim everything is predetermined, and that we can do nothing to change it, look before they cross the road.”
“I am pleased a book on science competes with the memoirs of pop stars. Maybe there is some hope for the human race.”
“My goal is simple. It is a complete understanding of the Universe, why it is as it is and why it exists at all.”
“I want to know why the Universe exists, why there is something greater than nothing.”
“No one can resist the idea of a crippled genius.”
-Stephen Hawking (all)
AstroDeci
Scratcher
34 posts

Not Turning at Desired Position

Now it's not going to the desired angle. I have it set so that it starts at 15˚, but it goes to -45˚ instead. What is wrong?

“I have noticed even people who claim everything is predetermined, and that we can do nothing to change it, look before they cross the road.”
“I am pleased a book on science competes with the memoirs of pop stars. Maybe there is some hope for the human race.”
“My goal is simple. It is a complete understanding of the Universe, why it is as it is and why it exists at all.”
“I want to know why the Universe exists, why there is something greater than nothing.”
“No one can resist the idea of a crippled genius.”
-Stephen Hawking (all)
scubajerry
Scratcher
1000+ posts

Not Turning at Desired Position

Because I said change = to < and you changed = to >
AstroDeci
Scratcher
34 posts

Not Turning at Desired Position

scubajerry wrote:

Because I said change = to < and you changed = to >
facepalm

“I have noticed even people who claim everything is predetermined, and that we can do nothing to change it, look before they cross the road.”
“I am pleased a book on science competes with the memoirs of pop stars. Maybe there is some hope for the human race.”
“My goal is simple. It is a complete understanding of the Universe, why it is as it is and why it exists at all.”
“I want to know why the Universe exists, why there is something greater than nothing.”
“No one can resist the idea of a crippled genius.”
-Stephen Hawking (all)

Powered by DjangoBB