Rotate multiple actors around central origin
The original functionality I was trying to create was the ability to change the direction of gravity on any axis but default physics / character movement only supports gravity on the Z-axis.
I decided that a good way to fake the direction of gravity would be to rotate the entire level around the center point. I'm experiencing some difficulty implementing this however...
I have tried creating a rotatableActor blueprint and having all objects inherit from it. When "gravity direction" is changed, I get all objects of that class and rotate them
It would be nice if you could simply rotate the entire level, but I don't think that is possible.
asked Dec 01 '17 at 02:35 PM in Blueprint Scripting
It's actually easy enough to fake gravity. Just disable gravity on the actor, and then on tick use Add Force to apply the desired gravity.
The gravity should be the desired vector direction multiplied by 980.
Baseline gravity, for example, would be 0/0/-980.
Using this method, I created something a while back that allowed a scifi motorcycle to drive along walls and ceilings, by getting the normal direction of the surface beneath and multiplying that by -980.
If you expect the actor to fall far enough, you may also want to account for terminal velocity. Just run a check on the actor's velocity see if it exceeds a certain length before deciding if force should be applied.
Follow this question
Once you sign in you will be able to subscribe for any updates here