Limit Rotation Range 180°

Can you show / tell us more about the rotating movement variable? All this code does is randomly multiply it by -1 sometimes…

Rotating movement is randomized and It shoud stay within the upper 180°.
See Blueprint as a text file.

284097-gg.gif

—>> [LowerNeedle.txt][4] <<—

*Note it has a Rotating Movement component. (142 around X). *
Any help would be a delight because it’s a very important part of the game.

Sure! It is kept simple. Auto-activate enabled and its rate is set to 142 around the X axis. So it’s an actor, a gauge needle, which I have rotated against a wall.

284099-rot.jpg

See red rectangles. If you copy and paste the .txt, the missing things are just the RotatingMovementComponent.

[LowerNeedle.txt][1]

Ok, thanks for that, but where’s the code that changes the actor rotation?..

Yes, I see the code, but this will not rotate a component. Is the needle a component in the BP?

Ok, we’re getting there. What are trying to achieve? Just the needle jumping to random locations?

Ok!.. :slight_smile: I’m with you. I never use the rotating movement component. I think you have your work cut out for you if you want to limit that to 180 because it’s constanly moving based on time and you have to try and jump in and try to figure out when to negate the rotation.

I think it would be much easier to just set the rotation of the needle using SetRelativeRotation.

Will get back shortly with an example…

Oh, indeed it is!

Absolutely, iIt should look like it’s thinking by itself, based on a psychedelic experience I had where I saw a very alien clockwork that looked like:

284001-download-3.jpg

Imagine the whole thing tightly “working” together. Between the green and red bar, there’s another needle going straight up, which pokes the upper ring. At each poke, three words from the upper ring bind together and get steadily shot out of the top. The words should stay horizontal and not rotate with its bottom to the ring.

284116-needle.gif

I have placed TextRender components as ciphers into the upper ring. They should spawn random letters while being out of sight in the top half (ev. Triggerbox)… it would be simply astonishing to recreate this 1:1.

What is this node called and where do I drag it out?

284117-relra.jpg

Getting only this:

Ah, I splitted it now but…?

Yours is way different – could you send me the Blueprint in.txt? :slight_smile:

SetRelativeRotation

( you drag it from your arrow component )

That’s ok, just different kind of component. Just right click the purple ‘new rotation’ pin and you can split in into 3, then you can connect the float :smiley:

Oh, sorry, for the current rotation, pull the pin and look for GetRelativeRotation

No, you’ve still got SETrelativerotation, you need GETrelativerotation :slight_smile:

Got it! But it’s spinning around the wrong axis and it looks hilarious lol.
I tried spinning BP and component but it stays the same.

And, any way to make it move more smoothly and less direct jumpy? (Edit: Fixed by lowering Interp speed)

284124-wra.gif

It works on the X axis

  • How can It rotate from the the bottom of the needle?
  • In-game, it is 90 degrees different than in editor. How can I match it up?
  • Should something be written in this variable range?

284125-var.jpg