Project Zomboid

Project Zomboid

50 ratings
How to create detachable and animated parts for any vehicle!
By Dr.Gustavo
In this guide I will teach you step by step how to create detachable parts that contain your own animation for Project Zomboid vehicles.

Thanks to Dante271 and MrDanny for teaching me the basics of animations in order to create this guide.

2
2
   
Award
Favorite
Favorited
Unfavorite
Introduction
Before starting to create the animations, we must create our model and designate which parts we want to be separable from the vehicle, in this case we will take the Culver Empire from Mafia 2, which I modified to separate its parts, I will not go into many details of the creation of models, if you need help with that part look for other guides.

For this guide I will be using the Blender.

Designation of groups for the pieces.
First, we must decide which piece to start the animations with, in this case I will start with the left front door.



Note : We also have to make sure that both the door and the body of the vehicle are at zero coordinates, that is, at the origin, so that there are no problems when entering it into the game.



The next step is to create a vertex group for the door, which can be done by going to the 3 green circles on the left of the screen.



We click on the "+" button and a group will be created, to which we must change the name by double clicking it, followed by this we must enter edit mode, select the entire piece and press the Assign button.



Once that is done we must place the orthographic left view.



And once there press the Shift + Z keys to enter the Viewport Shading view.



Now, with the mouse we must select the part from where we want the door to open, similar to real cars.
We use this view so that it picks up the faces that cannot be seen with the naked eye.



Now press Shift + S and select cursor to selected.



This will move the origin point to the center area of ​​the door.

Now in object mode, we create an Armature, and since we moved the origin point, it will be created right in the middle of the door.



For an easier perspective, I recommend turning this option on in the bone properties.



Now if you want you can adjust its scale and position to your liking.

Congratulations, you've created your first bone for animations!










Creating the animation I.
Note : Before you start creating the animations, select the bone, go into edit mode, and rename it to the same one you placed in the vertex group. (In this case front_left)

Now we have to enter the pose mode, to do so we must select the bone, and at the top right where object mode appears, we will select pose mode.



You will notice that the aura of the skeleton will turn light blue.



Now we have to select the door and go to the modifiers.



Here we will place the main bone (Armature) and the group of vertices to which the door is associated.



We return to pose mode by selecting the bone, and if we rotate it we can see that the door moves with respect to the bone.


Creating the animation II.
Now we will go to the Animation tab, which is located at the top of the program.



Here we will have to go to the action mode to be able to create the animation starting points.



Note : Remember to select the bone in which you want to create the animation.

We will click on "New"



And the time bar will appear below. Then we have to change the name of the animation where the "New" button was for one that suits us.



Now, at instant zero, we must press I and select the option Location, Rotation and Scale.



This will create a keyframe in the second zero, where the animation will start, now we have to move the time bar with the mouse to the next position where we want the animation to end, and with that move the door, to move it you must move the bone, NOT the door, and once you decide where it will end up, press I again and choose Location, Rotation and Scale again.



And ready! You have your animation for the door.


Anchoring parts to the created animation
Now we will see the topic to add some extra part to our animation, in this case, the left front window, which goes with the door.

For this we create a group of vertices for the window with the SAME name as the door, that is, they share the group.



We apply the same modifier as when we did it with the door, and voila, the window will move with the door!



Creating other parts.
To continue creating the animations of the remaining parts, it is the same process that I explained in the previous steps.



Only instead of creating a new Armature, we select the first bone we created, enter edit mode, press Shift + A and it will create a new bone where we designate it, only both will be part of the same Armature.





And to create your animation, we take the animation already created, and we duplicate it.



Now in that duplicate animation, we change the name, we go to the original bone without changing the animation, and we delete its keyframe, we do this so that the right door does not open at the same time as the left one.

To delete them we click on them and press X.





Then we create the new animation points.



We do the same with the rest of the separable parts.

And done!





Extra : Parts without animation.
For those parts that do not contain animation, such as the windshield, we simply leave it with a separate name, but export it along with the rest of our file.

Time to move it into the game.
We export our entire selection in FBX format, then we go to the base script of our vehicle.



Inside we will create a base module for each separable part we have.



Then in each part that has animation, we follow this format.



And for the door to appear, we have to look at the itemtype, in this case it is Base.CulverLeftDoor.

We save the file and create one with the suffix "Items"



And you follow this format, just adding a 1 at the end.




Conclusion.
Now with this you know how to create animations for your vehicles.

I hope that the guide has served you and was to your liking.

If you have any questions, don't hesitate to contact me!

My Discord : Dr.Gustavo#5833
10 Comments
Typpy San May 8, 2024 @ 11:46pm 
I tried it
and it doesn't work
When I remove the static parameter the parts are in place but the animation can't run
(I know what the cause is because if static is true then the animation won't work)
then I tried to make the static parameter false and the part model disappeared
What do you think is the problem that makes it happen like that?
is it on the model?
in writing the script I am sure it is correct
nosalisCZ Mar 3, 2024 @ 3:39pm 
thank you for writing this up! very helpful
Zodd Dec 21, 2023 @ 1:12pm 
I could really use some help with this
Zodd Dec 21, 2023 @ 11:52am 
I keep trying and failing, is it up to date? I will keep trying, without this guide i would have nothing to go by, I know it is my own mistakes
Diegus Mar 22, 2023 @ 7:06pm 
Thank you so much!!! I've been looking for a tutorial like this for months and I finally found it!!! I thank you again for the work you did.:steamhappy:
ESuances Feb 8, 2023 @ 3:01pm 
Wish I had seen this sooner, thanks a lot for the guide man! :spiffo:
geras Jan 24, 2023 @ 8:21am 
I've been waiting for a guide like this!
Thanks for the time you took to put this together.
I'd be nice to see a full tutorial how to make a car mod from scratch.
Nachooooo Jan 18, 2023 @ 1:07pm 
This is awesome! Can you make one for making a car mod from scratch?? The guides to making a new car mod are extremely outdated and would love to see how you do it!
Levroxxie Jan 11, 2023 @ 8:00am 
if you scrolled this far manually, happy 94th birthday!
kayak Jan 9, 2023 @ 11:35pm 
ok