I’m trying to figure out the correct way to properly create an aircraft actor.
Here’s what I have:
A mesh of an aircraft, with landing gear. I’ve rigged the mesh with bones (control surfaces, landing gear) and animated the landing gear. I’m importing this as a skeletal mesh into UE4. I then intend to create a blueprint where I handle running the animations and rotating the control surface bones.
Here’s what I need:
The aircraft needs to have hardpoints for missiles and bombs. I need to be able to attach missiles/bombs (other Actors) into the hardpoints from the blueprint/code, and also be able to detach them.
And here’s the problem:
I’m having hard time figuring out the correct way to implement the hardpoints. Here’s what I’ve tried:
I added dummy objects to the mesh in 3DS Max. I used to define the hardpoints this way in Unity (I could then access the sub objects of the imported mesh, find out their names and positions etc.). Unfortunately UE4 does not import any “metadata”, meaning that all that comes out is one mesh. So no dummy objects and no way to access them.
From that I figured that creating the hardpoints as extra geometry / separate dummy meshes is also out of the question (and would be a pain in the **** to do).
I can see there are sockets and the documentation describes them pretty as exactly what I need. I can add them to bones but in this case it only makes sense to add them to the root bone. Also requires me to painstakingly move each socket to their place where the mounting of the missile/bomb should be. Not to mention that, say if you have ~20-30 aircraft you need to rig that way… well, I’d rather not. I’d rather do this kind of stuff straight in 3DS Max where I could fit and test each separate mesh component in the correct place and then determine the attach points there and, like previously stated, carry that information over in dummy objects. Besides, I’d like to have a SINGLE blueprint for ALL aircraft, with each different type being generated from data with the mesh filled in, hardpoints filled in, etc…
I’m thinking I need to export the hardpoint positions as metadata, separate from the FBX, and forget about sockets as I don’t think I can create them from code or blueprint anyways.
So I guess I just answered my own question and I’ll just have to create a script to export the hardpoint positions and rotations from 3DS Max, and then read that data when constructing the actor. Any better suggestions?