# Vehicle Mud Flap Physics Going Crazy!

Hey guys,

So I have a bone at the end of my vehicles mud flap on both of them and when I press play they work like they should but when I drive and steer left or right they want to rotate and go forwards and backwards instead of flapping forwards and backwards.

So you can see in this pic it has been rotated, so what can I do to it in the animation blueprint, to make it rotate just a bit and to flap forwards and backwards when the vehicles brakes have been pressed?

This is what the physics asset looks like.

So does anyone know how to fix this?

Thanks!!!

OK so. Sorry if I sound patronizing, but have you tried putting the flap on a restrained physics constraint?

Ya and it doesn’t do much good.

Alright. What exactly drives the motion of the flaps? Pure physics or a coded behavior that relies on speed/acceleration?

I want the pure physics so I don’t need to do a bunch of complicated coding. Could I do like a lookAt node to it in the anim bp or something like that? Thanks for the reply

For that, I can suggest two actions:

One, use the “Set World Rotation” (or Set Relative Rotation if you did get parents to work - I will be using the Set World Rotation in this example). Get both the vehicle’s and the flap’s world rotation. Add a Break Rotator node to each one, then a single Make Rotator. As the three nodes, you will be using the vehicle’s Yaw and Roll, and the flap’s Pitch, and use this new rotator as the input for a Set World Rotation that runs on an EventTick. That way, every tick, the game will force the flap to remain aligned to the body without inhibiting it’s swing, because you’re using it’s own pitch (Bonus points: with that technique, you can also take the vehicle’s Pitch, add a float + float node and a float - float node, make a variable called “FlapLimit” with something like 40 for the maximum angle you’d want, then you can feed these two values into a ClampFloat node with the flap’s pitch as an input, and it’ll clamp the maximum angle of the flap - it’s like an absolute version of a physics constraint’s limits, but this is optional)

Second, and this is ONLY if you are experiencing physics freakout: it’s possible to create, with a Get Velocity node, a physics damper - but that’s a little bit more annoying to deal with, so I don’t want to go into details if I don’t have to. But let me know if you need anything else

Alright I’ll try it! Thanks for your help and time!

Ok, so I did what you said but the mud flap is rigged to a bone so how do I cast to that bone? And also are you doing this in the blueprint or the animation blueprint? Thanks!

Does anybody know how to fix this?