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"

Unreal Engine 4, how to modify world axis while preserving gravity

I have the following scene: There's a room with a pressure plate that opens a door for 2 seconds, a cube, and a sphere. The player has to simply exit the room. The sphere and the player itself can activate the pressure plate, but the cube cannot.

Also, the player cant activate the pressure plate and make it to door in time.

I want to make it a bit more interesting, by rotate the whole room by 5 degrees, so even if the player wants to grab the sphere and put it on the pressure plate, the sphere will roll away, and the player still won't make it.

He will have to block the sphere with the cube (so it wont roll away), and only then can get out.

alt text

I'm encountering a problem when I make the door open after hitting the pressure plate:

The door is initially rotated 5 degrees around the X axis (green rotation, consider it as the depth axis), which looks fine as in the upper picture.

But after the opening (looking at the bottom pic), having a rotation of 5 degrees around X and 90 around Z (the blue rotation, height axis) makes it look really weird, since it is not rotating around the Z axis of the "biased world" .

I thought about simply changing the world's axis, instead of calculating the transition matrix between the two axis systems, and then I could just rotate the door 90 degrees around the biased world's Z axis, of course while preserving the original direction of gravity.

If there are any other solutions I'll be glad to hear them as well

EDIT: I've come up with another solution, which is simply rotate the door around the vector representing the Z axis in the "biased world", and yet I can't find a way to directly rotate an AActor around a given vector.

Product Version: UE 4.14
ue4grav.png (456.0 kB)
more ▼

asked Jan 07 '17 at 08:42 PM in Blueprint Scripting

avatar image

1 1

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

2 answers: sort voted first

You have to change the orientation of the bones controlling the actor. You want 'X direction with Z up'. It also helps to change the axis to up in your 3D software. Hope that helps.

more ▼

answered Mar 23 '18 at 11:50 AM

avatar image


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

if im getting this right you just want the door to rotate as it should if the room wasnt tilted, like if it were a actual room and you moved everything including the door.

the simple solution would be to make the door a blueprint and make the opening rotation in the local space.

alt text

capture.png (120.6 kB)
more ▼

answered Mar 23 '18 at 04:23 AM

avatar image

10.1k 33 10 25

(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