MovePartWith() public static method

public static MovePartWith ( Part rootPart, List moveWithParts, Vector3 position, Quaternion rotation ) : void
rootPart Part
moveWithParts List
position Vector3
rotation Quaternion
return void
Beispiel #1
0
 public static void MoveAlignLight(Part fromPart, Transform fromTransform, Part toPart,
                                   Transform toTransform, List<Part> partToMoveWith = null) {
   Quaternion rot = Quaternion.FromToRotation(
       fromTransform.forward, -toTransform.forward) * fromPart.transform.rotation;
   Vector3 pos = (fromPart.transform.position - (fromTransform.position - toTransform.position));
   if (partToMoveWith == null) {
     fromPart.transform.rotation = rot;
     fromPart.transform.position = pos;
   } else {
     KAS_Shared.MovePartWith(fromPart, partToMoveWith, pos, rot);
   }
 }