Download

Pivot problems - Panels moving around an axis

Just started with UE4 so probably missing something brutally simple. Basically I’m working on a panel that when hit (usually by a projectile), it rotates around so the player can no longer see it. It will be placed so that a wall will not be visible, basically a very simple target shoot sim where you shoot the panels and they flip down behind a wall.
After a period of time I want it to rotate back.
Here’s an idea of the panel:
49b86777a382ba6f774abdaa946e42cd69e9ad5b.jpeg

The first hurdle I’m coming up against is getting the door to rotate around a specific pivot point or getting the panel to return to the original position reliably.

Tried a number of methods and workarounds but none will work to what I need:

  • Using physics and a physics constraint to make the panel flip in the direction I need it to - however this doesn’t let me easily rotate the panel back to the position I need it to be in. If I set the rotation of the object back to 0, the panel maintains its velocity and simulates the physics to flip back down. Setting the velocity to 0 doesn’t seem to help…

  • Using blueprints to make the rotation, using a timeline and Make Rot, fed into Set Relative Rotation does indeed rotate the panel as intended but around the centre of the object.
    972782b84c55584ac1af8b418ca934c024ef00e4.jpeg
    Reading around on various forums (including this one) I’d need to edit the panel in a 3D program in order to set the pivot point to 0. Seems a little odd that I can’t just change this from UE4 so I’m sure I’m missing a trick here.

  • A combination of the above in various ways

I can get the panel to destroy itself once hit then replace itself eventually but this won’t work for the flow of the project I’m working on.

Any thoughts from anyone? Basically it’s the same door-hinge thing I’ve seen come up a number of times on the forums but none of these solutions seem to work for my needs.
I should note that this is a class blueprint as I intend to re-use the panels over many levels.

Your problem is, that it doesnt rotate like it should? → change the pivot in your 3d program so that he is at the bottom middle of the mesh :slight_smile:
For the rotating part I would create an actor bp which contains the mesh - “get” it in your event graph - drag the link out from the “get” node - rotation - change the value (timeline, value, variable,…)

Was worried the suggestion was going to be edit in the 3d program… I guess it’s time to learn to use one of those…

Not sure I understand the second part though? Can you explain a little more…

  1. it’s pretty easy to change the pivot in a 3d program -> e.g in blender you just have to move the 3d cursor to the position - space bar - set origin - to 3d cursor
  2. I just posted one way how you can rotate the mesh when it gets hit :slight_smile:

Oh I see!

Thanks for the help, time to download blender I guess :slight_smile:

When you have any problems with blender, make sure to post a thread into the forum → there are some really good blender users around (geodav, smokey,…) :wink:

I’m having a problem with the pivot, too. I’m trying to make a dragging system (like in Amnesia) and I’d like to drag doors by moving mouse. For this I need to have door’s pivot set not to the center of the mesh, but to one of its edges, so the mesh could rotate like a real door and not around its center. I imported a mesh to Blender, changed pivot (by changing 3d cursor position and then going to set origin → origin to 3d cursor) and exported it to .obj, but when I imported mesh to UE4 its pivot wasn’t changed - it was still at the center. I thought that the problem may be with .obj format, so I once again opened Blender, changed pivot there and exported mesh to .fbx, but it didn’t help… The pivot is still at mesh’s center. What am I doing wrong? I also tried to change pivot offset in UE4 and I actually managed to change pivot correctly to the position I want i to be at, but while playing a game, door rotate around its center, not around the pivot’s position…

In case you still have this need to change the pivot point and are not familiar with a 3D program, there’s a possible workaround:

As long as you only need basic shapes and require a fast solution, you could also do it in UE by converting a brush to a mesh with the right pivot point:

  • add a brush shape (Geometry) to your scene
  • move the pivot point to your desired position, then rightclick on the pivot point and choose Pivot > Set as pivot offset.
  • in the details panel of your brush (Brush settings), choose “Create Static Mesh”.

Now, a mesh will be created that has the pivot point set as you desired without the need of an additional 3D program.