public static MovePartWith ( Part rootPart, List |
||
rootPart | Part | |
moveWithParts | List |
|
position | Vector3 | |
rotation | Quaternion | |
return | void |
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); } }