How to rotate an object while moving it in one direction?

Hi everyone
I hope that somebody can help me out here.
I am creating a 2D-style game in coblocks.
I want the UFOs to rotate while moving down, but when I try to do that, they change direction.
Can anyone help me with this, please?
(The UFO-script is on the third script-page.)

1 Like

Hi @Rasmus_Broe!

The problem here is in move block.


As you can see, it uses direction relative to the current item transform. Therefore when you rotate the item, forward is also changes. You can avoid this using move to coblock, that accept vector in world coordinates.


Here remixed space with move to coblock, please, take a look.

Love this, @Rasmus_Broe - can’t wait to see the final product!

Geoff @ TechLeap

1 Like

Thank you very much, Ilya.
This was a little out of my league :slight_smile:
I must learn to use this “return” fuction-thing.

Thanks again!