x

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"

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

Issues:

  • Neither local or world rotation seems to have the desired effects; objects rotate around their individual origins, not the center of the level

  • Not sure how to determine the center of the level, or even how I would rotate around that point

  • Implementation feels sloppy, there is probably a cleaner way

It would be nice if you could simply rotate the entire level, but I don't think that is possible.

Product Version: UE 4.18
Tags:
more ▼

asked Dec 01 '17 at 02:35 PM in Blueprint Scripting

avatar image

OscarFTW
1 1 1

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

1 answer: sort voted first

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.

more ▼

answered Dec 05 '17 at 06:14 PM

avatar image

Grimwolf
157 14 17 27

avatar image aNorthStar Dec 06 '17 at 04:20 AM

I just upvoted Gtrimwolfs suggestion, it is simplest and performance light. If I was aiming to rotate the level though, I'd put a scene root at 0,0,0 and make everything a child of it... then I'd rotate the scene parent. I'm not sure it would work, but it's an interesting challenge :)

avatar image Unzkilled Dec 06 '17 at 01:22 PM

It does, I've already done this

avatar image User609571414 Dec 06 '17 at 01:31 PM

Awesome tip Unzkilled. i'd been thinking about trying this, nice to know it works. Definitely try it out now.

(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