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
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.
answered May 11 '16 at 06:21 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here