Announcement

Collapse
No announcement yet.

Problem with wheels collisions

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

    Problem with wheels collisions

    Hello!
    Recently I started to learn to use UE4. I wanted to make a simple working vehicle, but there is a weird problem with wheels physics: they don't work.
    I checked all solutions I could find, but nothing helped. In most cases the problem was about wheels' location, but I checked hitboxes with pxvis collision command and they are in the right place. They even collide with the player camera in play mode, but they go through the ground and other physical objects. To test it I even tried moving all other hitboxes except wheels few meters up to see if wheels' hitboxes are misplaced, but they aren't. I checked skeletal mesh few times, but it's not the problem.
    Also: only wheels had this problem while the rest of the car interacted normally with physical objects.
    I tried everything I found and I can't see the problem, but it still doesn't work. I use the newest version of UE4: version 4.24.0
    Here are some screenshots:

    #2
    By the looks of it, the model is probably not rigged correctly - your skeletal mesh is probably the problem.

    Also, the wheel RADIUS is 47.5 ???
    The diameter is a whole meter? 95 cm? what sort of car is this? O_o


    you need to try and find the way to debug the wheel components. I can't remember what command it is, but it's something like showdebug.cls or it had cls in it for collision, I'm almost sure of that. Anyway, once you are able to render where the wheel component actually is at (because it's not the wheel you see, the component's collision is invisible in editor and a factor of your radius+width parameters for the wheel). you can move forward with testing.

    While in there, make sure your PHAT has kinematic set for the wheels collision. maybe you just have no collision on those in Phat.

    Comment


      #3
      Originally posted by MostHost LA View Post
      By the looks of it, the model is probably not rigged correctly - your skeletal mesh is probably the problem.

      Also, the wheel RADIUS is 47.5 ???
      The diameter is a whole meter? 95 cm? what sort of car is this? O_o


      you need to try and find the way to debug the wheel components. I can't remember what command it is, but it's something like showdebug.cls or it had cls in it for collision, I'm almost sure of that. Anyway, once you are able to render where the wheel component actually is at (because it's not the wheel you see, the component's collision is invisible in editor and a factor of your radius+width parameters for the wheel). you can move forward with testing.

      While in there, make sure your PHAT has kinematic set for the wheels collision. maybe you just have no collision on those in Phat.
      So turned out my all issues were caused by my horrible blender skills. (Including car's size, it was supposed to be half the current size) Also it turned out wheels were at the bottom of the car also rotated wrong, but I don't know how to fix this in blender. Will probably take some time, before I figure out how to fix it. Also thank you, that debug ccommand helped me a lot and will probably help me in future. Time to learn blender more :P

      Comment


        #4
        Pretty easy. Edit the bones and rotate them 90deg. On the X or Y axis.
        the diameter/radius thing is not uncommon don't feel bad.

        For the car rig (basic) you want 5 unlinked bones.
        root, and 4 wheels.
        The 4 wheels have the root as their parent.

        They should be positioned with X in front, Z above. You can change the display in blender to show axis for the bones and help you out a bit.

        Comment


          #5
          Originally posted by MostHost LA View Post
          Pretty easy. Edit the bones and rotate them 90deg. On the X or Y axis.
          the diameter/radius thing is not uncommon don't feel bad.

          For the car rig (basic) you want 5 unlinked bones.
          root, and 4 wheels.
          The 4 wheels have the root as their parent.

          They should be positioned with X in front, Z above. You can change the display in blender to show axis for the bones and help you out a bit.
          Before reading this I managed to move wheels to correct locations, but still need to change rotation. Also wheels' collisions seem a bit small (I checked all sizes and should be correct, but I will check once more)

          Comment


            #6
            This is more my opinion mind you, but tires inflate and deflate. You actually may want a somewhat smaller radius to have a little better looking adherence.
            Obviously if you overdo it it looks like you have a flat tire...

            Later on, you may even wish to play with the wheel material and tessellation to get the tire to inflate/deflate a bit.

            Comment


              #7
              But there's another problem. Once I rotated bones, wheels' collisions disappeared. I made sure I set up everything correctly, but they're not there. It's not abput size, because I tried to increase their size (to few billion to see if they even exist), but they're not there. I set up all physics, animation and made sure skeleton is correct.
              What could be wrong this time?

              Comment


                #8
                Can you share a screencap of the bones?

                And are the wheels displaying with the same collision command as before?

                Could be lots of things, but the top of the list is bad rotations or parenting of the bone structure.

                Comment


                  #9
                  I noticed how rotating bones has no effect on it, but rotation joints does. Parenting is done correctly. Showdebug command doesn't show wheels' collisions anymore tho. I tried to do everything same as before, except I rotated those bones...

                  Comment


                    #10
                    The bones are wrong. They should be all leaning on one side.. usually towards the camera angle since the front of the car should be X forward.

                    In the way they are now, the tires would be flat against the floor.

                    To change the bones, go into edit mode. Selected them all with a, change the binding to individual origins, press R to rotate, type X to lock the axis, and 90 to see the effect.

                    Should they go the wrong way you just need either a minus or a different axis (hit y).

                    Anyway, there's a few youtube tutorials you could watch on this to better understand how the rotations on the root work.

                    Also, do make sure you didnt double the bones. The black edge looks a little to bright. Could be your interface settings. Could be you accidentally duplicated the bones....

                    Comment


                      #11
                      I did everything as you told me to, but wheels are still not there... I'll redo everything following tutorial, maybe I missed something important

                      In the photo you can see what happened when I moved the body hitbox up. Wheels' collisions are just not there...

                      Comment


                        #12
                        No, it still doesn't work, I think I'll redo model, or use pre-made model if it'll change anything...

                        Comment


                          #13
                          A few things to check.
                          I red some posts about 4.24 not working the collision of the wheels correctly.
                          Since you seem to be using the landscape, try adding a big stretched box under the car above the map.
                          something like 100 x 100 x 0.1
                          just to test collision. Make sure block all is set on it.

                          Second thing is definitely the model.

                          Delete the armature and start from scratch.

                          Add the first bone at 0,0,0.
                          Extrude out 4 bones (click the tail, press e, Z to constain and 1 as the size, or even 10, size is purely visual).

                          In the bone options panel you then disconnect the bone.

                          Swap to object mode,
                          Select the wheel and ctrl A to access the Set cursor to active option.
                          once the cursor is moved, go back into edit mode on the armor, select the bone, and with ctrl a choose set active to cursor.
                          that should move the pivot where it needs to be.

                          Next up the rotation.
                          go into object mode and trigger the axis display in the armature settings.
                          with the bone axis on screen you can choose which wat to drop the tail of the bone. To have the wheel align correctly.
                          alternatively - and probably easier - set the cursor as the pivot point and rotate the bone by 90deg the appropriate direction.

                          export and test just the one wheel. If you get it working you can quickly duplicate and properly name the rest of the bones following the same process for aligning them to the wheel.

                          except you won't need to repeat the rotation. All tails are supposed to point the same direction.

                          Comment


                            #14
                            Ye, thanks, I'll try all that. But first I'll make a less fancy model, so it's easier. Like a cube with wheels

                            Comment


                              #15
                              So after trying to make it all again from scratch...
                              (Red sphere in the screenshot is not car's collison, it's there even if I delete car)

                              Comment

                              Working...
                              X