Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Add random rotation around axis of static mesh?

I'm trying to make an asteroid belt, just wonder how you would go about giving a static mesh a random rotation in all directions smoothly while staying in place?

I have the outer rocks already rotating on the yaw around the middle point, also trying to figure out how to make the rotator spin in 360 instead of the same degree

alt text

alt text

alt text

Product Version: Game Mod
more ▼

asked May 11 '16 at 05:34 AM in Blueprint Scripting

avatar image

Samson F.
56 29 17 25

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I do it by adding a rotation every frame. The rotation to add is fixed, but it's set randomly at BeginPlay, so each Actor rotates at a different rate and in different directions.

To be easier to implement the behavior in other actors I do it as an ActorComponent.


alt text

The var DegreesPerSecondMinMax is a Vector2D and RotationSpeed is a Rotator.

If you're gonna have hundreds of these though, I'd recommend to rotate all at once inside a loop in PlayerController or some other manager class. It's faster than having a lot of actors ticking in your scene.

Or do it with particles. Then you could make them GPU particles and have thousands of them.

capture.png (291.5 kB)
animation.gif (4.4 MB)
more ▼

answered May 11 '16 at 06:21 AM

avatar image

1.1k 28 39 90

avatar image gestoryscht Dec 06 '17 at 02:46 PM

This works like a charm, but I have a question. How do you added the 'Degrees Per Second' as a single node with a Float Output and how do we get the 'Set' Node at the end?

Thanks for your kind help!

avatar image robbiethewabbit Dec 13 '17 at 05:53 PM

Create a Vector2D, drop it to event graph then right click on it and split struct pin. Then drop Set DegreesPerSecondMinMax to your event graph and also right click on it (in the Rotation Speed values area) and select split.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question