I really need help with rotating overlays


#1

I am struggling alot with rotation, I’ve never done it before so I have no idea how it even goes. I’ve read about it but when it comes to writing it on the script i’m having a hard time. Please help I want the grenade to come in flying & rotating (spinning at the same time) here is the script: (line 280 on down)


#2

refer to Dara’s thread for help


#3

Here’s a link to a page I like to refer to when working with overlays:

If you’re still unsure or having trouble rotating after reading this article, feel free to let me know. :slight_smile:


#4

I’ve read it before but i’m so confused/ struggling really bad with the “anchor points” :confused: would you be able to help me? & would it move or mess with the shifting?


#5

An anchor point is basically a point that an object will rotate or pivot around.

@overlay CAR BUG REAR rotates 360 anchor point 0 0 in 1

The code above has an anchor point of 0 0, meaning that the overlay will rotate/pivot around the bottom left corner of the overlay itself. In other words, the bottom left corner of the overlay “box” will stay in place while the rest of the overlay will rotate in a clockwise direction for however much time you specified.

The only other anchor point that may be of interest to you as of now is this one:

@overlay CAR BUG REAR rotates 360 anchor point 0.5 0.5 in 1

An anchor point of 0.5 0.5 is located in the middle of the overlay and rotating it this way will make the overlay rotate in place. To fully understand what I mean by that, if you haven’t already, you should try it out in the portal.

Finally, to know if it would mess with shifting depends on what exactly you do. You will have to play around with it, but for what you’re doing you just want to make sure that the rotating and shifting is occurring at the same time.

For now, try out what I said (if any of what I said made sense, lol) and see if it works for you. If not, just come back and ask more questions. I’ll be here :slight_smile: (unless I fall asleep :joy:)


#6

Okay, this is what i have… It comes from the bottom of the screen :persevere: I think i’m most likley doing this wrong

i’ve been working my butt of this whole week, & I think i’ve nailed it with most of the zooming and other features in one week but I think the hardest will be this & layering them (I have this scene on zoom by the way)


#7

Well, since you want it to come from offscreen, I think the best way to do it is first specify a starting point offscreen that it will start from before it shifts onscreen. You haven’t done that so the code is shifting your overlay from wherever it spawned from (in this case somewhere at the bottom of the screen). I suggest adding something like this in between lines 280 and 281:

@overlay GRENADE shifts to (inserts numbers here) in zone 1 in 0
@overlay GRENADE scales to (insert numbers here) in 0

See if that will fix it. :slight_smile:


#8

I redid it & it definitely comes in much better but it dosen’t come in rotating :confused:


#9

That would be because you didn’t specify a time in seconds. Since it takes three seconds for it to shift into position, also specify it to take three seconds for the rotation on line 285. Keep in mind, the code you’ll have after doing that will only rotate it once. Not sure if that’s what you wanted or not, but fixing that one part will allow it to rotate. :slight_smile:


#10

Ahh, it worked! Almost there :slight_smile: but how would you determine how fast you want the spinning to be? Is that possible? Like it comes in flying sorta fast but the rotating (spinning) is slower? Would there be a way to fix that? And so shifting & rotating should always be same amount of time?


#11

To speed it up or slow it down, just change the time duration. The less time you specify the faster it happens and vice versa. However, since you’re also shifting at the same time, you want both the rotating and the shifting to end at the same time. They don’t always have to be the same, it depends on what you’re doing. It’s easier to make it rotate more/faster than it is to slow it down when shifting the way you are doing. Is it happening too fast or too slow?

Also, I’ll probably be asleep by the time you answer this so hopefully you can continue on your own for now. :slight_smile:


#12