Announcement

Collapse
No announcement yet.

Timeline issues - rotating an object relative to its own orientation, not the world's?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Timeline issues - rotating an object relative to its own orientation, not the world's?

    Using a timeline to move an object is easy enough. And moving it along three axes at the proper speed is relatively simple. Not so much with rotation. The problem is that I need the orientation of the actor in the map to remain as I have it set up. I thought this would be easily managed by rotating it by just using a tick event to add a finite amount to the yaw from within the actor blueprint, but add actor rotation refuses to accept decimal values below 0.1.

    The alternative, using the timeline to get smooth movement, creates its own problem. The rotation from the timeline when fed into the rotate node, resets the rotation of the actor to 0,0,0. I need the actor to spin slowly, along an axis that is not perpendicular to X Y or Z.

    #2
    Originally posted by Jakinirali View Post
    I thought this would be easily managed by rotating it by just using a tick event to add a finite amount to the yaw from within the actor blueprint, but add actor rotation refuses to accept decimal values below 0.1.
    These 3 work fine on Tick and values below 0.1:

    Click image for larger version

Name:	Untitled.png
Views:	1
Size:	37.6 KB
ID:	1131305

    Originally posted by Jakinirali View Post
    The alternative, using the timeline to get smooth movement, creates its own problem. The rotation from the timeline when fed into the rotate node, resets the rotation of the actor to 0,0,0. I need the actor to spin slowly, along an axis that is not perpendicular to X Y or Z.
    Here's the same looping rotation with a Timeline, this will create a smooth tumble:

    Click image for larger version

Name:	tl.png
Views:	1
Size:	138.3 KB
ID:	1131306

    If you need the rotation along an arbitrary axis, it should be enough to just set pitch/roll/yaw to a flat value and feed only one of them from the timeline.
    Last edited by Everynone; 07-19-2017, 06:07 AM.

    Comment


      #3
      Originally posted by Everynone View Post

      If you need the rotation along an arbitrary axis, it should be enough to just set pitch/roll/yaw to a flat value and feed only one of them from the timeline.
      Are you sure about this? I tested your example, rotated my pawn 45 degrees and then only use yaw, but the mesh does not rotate around its own axis. I've saved out a small simple project doing this if it helps.

      https://drive.google.com/file/d/1vEp...ew?usp=sharing

      Thanks!

      Comment


        #4
        I was sure about it 2 years ago, yeah. Not so sure anymore but...

        or else collisions will not work
        Can you elaborate on that?

        If you want to use relative rotation, it has to be relative to something:

        Click image for larger version

Name:	Capture.PNG
Views:	1076
Size:	194.6 KB
ID:	1595913

        vid:

        https://i.gyazo.com/4a4471061afefaea...75f30f1991.mp4

        Comment


          #5
          Thanks, I can't find my post where I mentioned collisions not working but essentially when you're rotating the root on its own and adding other rotation to the StaticMesh collisions won't like it (not sure what actually happens - rotations might ignore any non-root transforms so you might get something but it'll be wrong..). AFAIK transforms need to be on the top node for collisions to work, otherwise rotating different items in a hierarchy as you have done will work just fine.

          Thanks for the help though, this is still bothering me actually. All I want is the ability to rotate on 3 axis with collisions working. Did I miss something?

          On another note, the rotation axis in the editor viewport are aligned to global rotations only but you can quickly see the problem if you play with the rotation in the 'details' panel. Rotate X a bit and now when you rotate Y the ship will not rotate around its own local axis Y, not even if you set rotation mode to 'relative'.

          Comment


            #6
            Here's a thread I found that could work, I'm closer to a solution but still not quite there. Right now it's working on 2 axis but not 3 for some reason (pitch not working).

            https://forums.unrealengine.com/deve...-problem/page2

            Comment


              #7
              Collisions against the player or other objects? The character movement component attaches you to the floor so you slide through moving objects if you are standing still. If you just need the object to get stuck on other geometry, hit the dropdown on the addrotation node and check Sweep. If your object is simulating physics, use setAngularVelocity instead.

              Comment

              Working...
              X