I’m playing around with the basic vehicle blueprint, and I want to create a forklift.
I have a simple skeletal model that drives around, and inside my skeletal mesh is the “fork”. I added it so when you press a key, the fork raises and lowers (I use the transform bone node to do this). This works great as an animation, but breaks down when it comes to physics on the fork. I think it’s because I am translating the Z position of the fork, instead of applying a physics force in the Z direction on it. I have a physics box around the chassis of the forklift, and a box on the fork itself.
How do you go about applying physics to a bone?
What do you think is the best way to go about accomplishing this? Am I correct that if I want physics to be applied to the fork part, then I cannot rely on the “transform bone” nodes inside my animation blueprint?
I just want to be able to pick up stuff
Did you already find a solution for this? Have you tried to use the Physics → Add Force and Physics → Add Torque nodes in your Event Graph, using your skeletal mesh component as the Target?
In case that you do not want to compute the needed forces yourself, then you can use motorized joints. I’m not sure how to do this using Blueprints, but there seems to be something related at Physics → Components → Physics Constraint. (in C++, you do it via the linear&angular drive methods at YourSkeletalMeshComponent->Constraints[n])
edit: At least PhysX permits implementing this also via a kinematic animation, so that the fork moves in a predefined fashion and forces any physics objects in the way to move along (you have to avoid squeezing objects this way!). See https://developer.nvidia.com/sites/default/files/akamai/physx/Manual/RigidDynamics.html#kinematic-actors. But I don’t know what is the proper way to do this through UE.
No, I haven’t figured it out yet. Right now it behaves similar to those PhysX bodies, where the animation will push anything out of its way. I feel like I can’t have my forklift be 1 skeletal mesh. It needs to be 2, with the fork being able to have a physics constraint on it.
I’ve extended the vehicle BP to a forklift and can go up/down with the forks and pickup/move other physics assets like a pallet and box. All using skeletal mesh. I must have a different setup. Here it is in action - Unreal Engine 4 - Forklift WIP - YouTube
I’ll have to try it out on 4.8 or 4.9. It might have been a physics bug at the time.
What version are you running on?
Are you simply moving a bone of the forklift part up and down?
Video is sweet by the way!
I’m using 4.9.2 source. I’m using a timeline with a float track 5 sec. You should be able to see the BP and assets in the attachment.
Wow thanks for including that! I’ll be sure to try it out
I’ve learned everything I know about UE right here and the forums so that is the idea to give back a little Good luck!
Hi rennsix, It’s been a year since this post but I’m trying to replicate what you did without success.
I’m using Unreal 4.13.2 blueprint based project and also extended the vehicle BP to a forklift, I´m using skeletal meshes as components for the vehicle BP to use as forks as you suggested, but doing this seems to break all collisions for the forks and becomes useless for physics. How did you solve this issue? Was it with code?
Another way I’ve tried is attaching the skeletal mesh of the forks to a component of the extended vehicle BP in the right position and the collision seems to work fine but the forklift mesh seems to get an inverted weight weird effect and leans back a little, I’ve attached this issue.
Do you have any ideas on how to fix this or if I am doing something wrong?