Description
The Z
property of the PhysicsLock
struct is a boolean value that determines whether the Z-axis movement of a physics object is locked. When set to true
, the object is restricted from moving along the Z-axis, effectively preventing any translation in that direction. This can be useful in scenarios where you want to constrain an object's movement to a specific plane or axis.
Usage
To use the Z
property, you need to have an instance of the PhysicsLock
struct. You can then set the Z
property to true
or false
depending on whether you want to lock or unlock the Z-axis movement of the associated physics object.
Example
// Example of using the PhysicsLock struct to lock the Z-axis
PhysicsLock lockSettings = new PhysicsLock();
lockSettings.Z = true; // Lock the Z-axis
// Apply the lock settings to a physics object
PhysicsObject myObject = new PhysicsObject();
myObject.LockSettings = lockSettings;
// Now, myObject cannot move along the Z-axis.