How do I make my meteors rotate? (SOLVED)

I’m working on a space shooter as my first full-scale game. I’ve found answers for most of my issues, except I can’t make my meteors rotate. I made UFOs spin by creating an animation for it, but I want the meteors to spin at different speeds.

I tried copying the events/actions from the example shooter.

[code]Do =Random(360) to the direction of Rock
Do =Random(50)-25 to variable RotationSpeed of Rock

Do +Rock.Variable(RotationSpeed)*TimeDelta() to the direction of Rock[/code]
I changed it to suit my objects, but still no spinning. Any advice?

EDIT: I just got that code to work, but it’s not what I’m looking for. I thought it was to make it spin, but it just changes the direction that the object is facing.

Oh, in that case, you just need to increase/decrease direction of object. You just need to use “Do +(speed)*TimeDelta() to object” (with +/- depending on direction you want to rotate as modification sign).

I must be looking in the wrong actions, because that gives me a syntax error and doesn’t work. What action should I put this in? I tried “Sprite>Direction>Change the direction” and don’t see anywhere else it would go.

The next release of Game Develo will have an easy to use “Rotate object” action. :slight_smile:

For example, enter + instead of = for the second parameter, and 50*TimeDelta() for the third parameter, which is the angle in degrees.
Just modify the parameters so that you get the same sentence in the events editor as the sentence in Darkhog message (just replace speed by a value like I did).

Thanks for the responses. I got it figured out. My biggest problem was that I was using a sub-event. I used a standard unconditional action:

Do +Random(25)+TimeDelta() to the direction of Meteor

It’s a lot cleaner now and it works. :smiley: