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
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.
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.
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!
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.