In this recipe, we explore some of the possibilities of manipulating the Massbox that we created when first creating the car's XML. With increasing the Massbox of the car, we will see how the car is able to push lighter objects out of the way.
Complete the Creating a new car XML recipe. Then open MyVehicle.xml
in Notepad or an equivalent editor.
As simple as the previous recipe was, this one will be just as easy to make a massive change to your vehicle.
Begin by finding the car's part named massBox
. To increase the mass of the MassBox, simply increase the mass
= 1500
to a higher value such as 3500
.
A simple method to see the results of how easy it is for the car to move objects out of its way is to place down a basic entity with a mass of 1000
and then drive into it with the previous MassBox properties. Then repeat the process again with the 3500 MassBox value.
After changing any XML values on the car, you can reload the XML on the car by right-clicking on the vehicle and selecting Reload Scripts.
The MassBox is a special part of the vehicle that handles all of the physical interactions of the vehicle as a whole. Along with Arcade Wheeled as the movement behavior, the Massbox is the main point of reference for the car and all its parts for mass physics calculations (as long as all those parts remain on the vehicle).
It is possible to define the mass of other parts besides the Massbox. However, with Arcade Wheeled movement parameters, this property change will do virtually nothing, but with other movement behaviors it may change the driving mechanics such as the Wheeled Legacy (which should not be used as that movement behavior is no longer supported).
Still, there is a use of this property and that is if ever we want to create a part to be detached from the vehicle, this part requires a mass in order to follow the laws of physics for the CryENGINE, such as gravity.
3.137.216.175