Announcement

Collapse
No announcement yet.

Rolling ball + stretch / squash in UE4

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

    Rolling ball + stretch / squash in UE4

    Hi,

    I want to make a rolling ball, based on a third person template. I want it to roll, when it moves forward, but also to stretch and squash while jump (and rolling at the same time).
    If I understand correctly, I can only export bone animation to unreal editor, so no FFD modifiers, nothing like that. I cannot use rotating texture, as ball mesh is a complex asymmetric geometry.
    Also animation blending won't help in this case, as bones are actually rotating. And if I will try to blend a rolling forward animation with a lets say not rolling stretched jump (straight up), it will be somewhat weird interpolation of the two.

    Am I missing something? Is this possible to achieve desired behavior with the skeletal mesh and animation? Rolling + stretch and squash at the same time.
    Please let me know your thoughts, maybe there is another way to approach this problem?

    Thanks,
    K

    #2
    Yes just make the animation on the 3d sofware make sure to make some type of mat to distiguish if the ball is rolling and use animbp just like it is setup in tp project.

    Comment


      #3
      You could do the squash and stretch as a morph.
      Clarke's third law: Any sufficiently advanced technology is indistinguishable from magic.
      Custom Map Maker Discord
      https://discord.gg/t48GHkA
      Urban Terror https://www.urbanterror.info/home/

      Comment


        #4
        Thanks a lot! I will try both suggestions!

        Comment


          #5
          Because the ball is rolling you may have some problems applying morph to do squash/stretch. See how it goes. If it doesn't work out, another idea would be do the squash/stretch using material on the ball. That is, you could make a material to change the vertex position in world z to squash the ball into the ground.

          Another material-based idea to consider is using distance fields to do a "soft-body" look for the ball, see here: https://forums.unrealengine.com/deve...ld-soft-bodies

          Also, if "soft-body" is interesting approach to you, you could actually do a physics soft-body simulation for the ball and let the physics engine handle the deformation of the ball. Probably the best approach for that at the moment is Nvidia's fork of UE4 called "flex".

          See here for some soft-body fun in UE4 + Flex:

          https://www.youtube.com/watch?v=zfhsHXEgsXg
          My game: FisherBros - Platform and solve puzzles using a physics-based fishing rod.
          My policy: Need help or advice on a UE4 project feel free to PM me.
          My pocket money: Consultant at unrealconsulting.com

          Comment


            #6
            Hey Thanks a lot! Yes, I haven't tried yet, but I think I will definitely have problems with static morph mask verts and rotating geo of the ball.
            Currently I am trying to make a multiple bones inside a ball rotating and change overall shape of the bones by applying modifiers as overlay. But its tricky too, as mesh deformation this way creates lots of visual artifacts.

            Thanks for a suggestion regarding soft body and material usage, I will definitely look into that!

            Although my idea is to have something more manually controllable. Like if I increase a speed of the ball it will stretch in the direction of acceleration in a controlled way, etc.
            I think with some limitations I might scroll a texture of the ball (similar to scrolling a spherical mapping in a 3d software applied to a sphere), and not the mesh itself. This way I will be able to stretch and squash it using skeletal mesh and a scrolling texture as overlay. As an idea.

            Thanks a lot!

            K

            Comment


              #7
              Yes I agree, if you "fake" the actual rolling of the ball by using a material to make it look like its rolling, then you can use morphs or skeletal animations to your heart's content
              My game: FisherBros - Platform and solve puzzles using a physics-based fishing rod.
              My policy: Need help or advice on a UE4 project feel free to PM me.
              My pocket money: Consultant at unrealconsulting.com

              Comment


                #8
                Ok, I think I'm finally figured it out. Haven't tested it yet in UE4 though:

                Apparently UE4 supports up to 4 layers of bones skin. So I can have lets say two layers of bones, one will be rotating bone and the other is stretch / squash.

                link: https://answers.unrealengine.com/que...mitations.html

                So will try this now. I only need 2 influence layers for my ball to work properly. So far I think this is the most elegant solution and the least complicated one. Although I need to test a performance cost for having 2 influence layers.

                Cheers

                Comment

                Working...
                X