Vehicle Part Animation/Physics Bug?

Hello,

I posted this in the forums, but I think this is another type of area to ask questions? I am not sure if I found a bug, or need to setup things differently or what? But if you look at my post here, I show what the issue is I’m seeing…

Has anyone else tried this / run into the same issue/got around it?

I really would like to be able to animate parts open, then enable physics. Then if possible, if the part (door) slams closed, it turns off simulation, so I can animate again. Also if physics are running and the door is open/ hit hard enough, it breaks off.

I’m not sure if I can do all this via a skeleton/physics, or if I have to setup as attachments or something via blueprint/sockets? Or if this requires custom C++ , which is then probably over my head.

Link to my post:

Video showing my issue:

Thank you!!!

I’m in the process of testing via a socket now. I broke off the trunk of my vehicle into a seperate skeletal mesh with 1 bone. Then attach in the vehicle via the socket. I have a morph target / tracing working on it, with animation, so that’s good. The only thing to test/figure out yet is the physics/constraint. I tried to simulate physics and it dropped straight off. But I might need to setup constraints on the trunk/socket yet… I’ll try tomorrow AM again.

Edit: I need to rename some stuff too I think. Right now my detached trunk bone is named the same as the bone in the vehicle skeleton. So I am probably hitting the same issue. Maybe if I rename the vehicle one , and leave my socket version alone, it will work better… In another post someone mentioned simulating on the second bone in the chain I think… Unless I have to have 2 bones on my trunk and one is the “root” that is bound to the socket then the other is what the mesh is skinned to.

Very weird stuff… But it might be me just not understanding the system well enough yet.

I’ll add an extra bone to my trunk skeleton for now, and simulate 2nd bone/below and test…

Hello mLichy,

I’ll be looking into this issue and trying to find the problem. Would it be possible to get a copy of the FBX for this asset so that I can deal with the issue itself? If you wish to keep it private, you can send it to me in a private message on the [forums][1]. Also, when looking at the video I notice that before opening the door that the car is very low in the back. Is this what you want the end result to be or do you wish for it to look like it does when the door is open?

Hey,

Yeah , I can send a PM. The bone count is crazy now , but I will be optimizing that a lot. The back is stuck down from the “bug”. When I enabled physics in that case , the back releases then, and the car returned to its default pose.

When it’s hanging down, it’s pinned to the ground and I can’t move. Until physics was simulated again on the door.

I can send the file tonight or tomorrow AM.

Thank you!!

I will test the 2 bone method tomorrow AM on the trunk. Simulate on bone 2 and not the “root”. See if that does it or not. Bone 2 on the socket attached trunk.

I am testing 2 bones now on the trunk. But, it’s sort of fixed. I can animate the trunk yet, and it doesn’t generally pin down the car, in 1 case it did. But the issue now is that, even when I tell it to simulate physics after interaction/animation, it won’t update/apply.

I set the root node to Default or Kinematic, then same for the trunk geo/bone. Then on interact, turn on physics on the 2nd bone/trunk. But it still is static/kinematic. hmmmm

Thank you for providing all of the necessary assets. It seems that the main issue may be how your skeleton hierarchy is set up for your car. Having the door’s direct parent being the root would explain why it falls off as soon as you begin to simulate. You may want to look at the Advanced Vehicle template to see the skeleton used there. You also have the option of using sockets for these pieces instead of having them be part of the actual mesh.

As for the door breaking off, it would be best to set up a breakable constraint for the hinges. These settings can be found in the expanded settings under Angular/Linear limits in the Constraint Mode of PHaT. A good place to learn about that would be the Physics map of the Content Examples project.

I hope this is able to point you in the right direction!

Thanks! Yeah, I’ve tried binding the door to another bone, and even setting up the skeleton so that there’s a root node, then belair/chassis, then door a child of the Belair/Chassis. So it wasn’t under the root directly.

I’ve also tested/setup the trunk as a socketed attachment, which is a skeleton. Then tried using 1 and 2 bones in the trunk skeleton, and doing various tests as noted above.

I can take a look at the advanced one. Hopefully I can get it to work. Does the advanced version swap between kinematic and simulated states? I would like to have the door “static” so I can animate it and not be always simulating , then when its open/anim end, start the simulation.

My plan though is to break up most of the parts into static meshes or skeletal meshes and attach to sockets. The only issue I had to solve yet is the simulation stuff.

I’ve personally yet to attempt animating particular parts of a vehicle in the way you’re attempting to. I’ll give it a try myself and see what I can come up with. I’ll let you know of anything I manage to find.

Oh ok, thanks! Yeah, I don’t know if many people have yet, that I’ve seen.

I was trying to do it in the way I am, so it’s more “procedural” and not baked into an animation.

I’ve setup the tires as static meshes, attached via socket now. Then also setup the door as a separate skeletal mesh, that is attached via socket. But I still have the same kinds of issues.

Edit: I got it so that it is simulated at the start, then when I try to interact / open it, it snaps to the end position of the animation, then physics stop working. I am disabling physics, animating it, and enabling again. That breaks it somehow.

Edit: I got it working! Almost. It does work, but it starts to stray from the socket connection when I start moving faster and faster, when physics is turned on. I think I saw a fix for that, but forget what exactly. I thought something like checking an option to update physics faster.

I think the issue Might be from blending physics off and on after enabling. I removed that node entirely and I think maybe was it. But I also was changing the bone setup. So I need to figure out for sure what it is. I’ll report back.

I think it might be that I have to have a root/door bone in the door skeleton, then bind my geo to that second bone. Then like I said before, don’t do the physics blend stuff after enabling/disabling, just turn it off/on and that’s it.

I got both doors working now, but I just need to fix the socket attach position issue when physics are enable, as it delays/lags behind.

In the end, I setup 2 bones as I said, then set both the root and door bone to kinematic in the Physics Editor. Then setup my angle constraint.

Here’s a new video showing some fixes, but also more Physics/Collision Issues. Although maybe I should put into a new thread?

You can see that if I try to make a more complex Collision setup on the Chassis, it starts to freak out, with other physics objects maybe. But, there really shouldn't be anything interfering I don't think, unless the tires are somehow....

The other freakout when I went off the ramp, is from standing on the physics box (chassis collision), then getting into/possessing the vehicle. It seems to keep the last physics pose or something and screws it up as well.

How might I go about fixing this then? From what I gather, I have to do collision on the root, since it’s ignored otherwise… Unless I can delete the PHAT stuff and just use collision boxes/ect through the components?

Edit: I started testing / implementing my own vehicle suspension/simulation, but it might be too advanced for me in the end.

I was able to kind of get around my issues, but making 2 collision boxes, then in my LineTrace, only look for the World Dynamic types, so I can ignore the main body collision and only interact with my doors/ect. Then I had to set my parts of the car to ignore vehicles in the collision settings, otherwise it freaked out.

I still may mess with other vehicle ideas, like the “floaty” vehicle test I did above, and I’ve been messing with making a vehicle made of physics constraints as well.