Version: Unity 7.0 Alpha (7000.0)
LanguageEnglish
  • C#

TransformRef.SetLocalTransform

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void SetLocalTransform(float4x4 localToParentMatrix);

Parameters

Parameter Description
localToParentMatrix A matrix representing the parent-relative affine transformation.

Description

Sets the local (parent-relative) position, rotation, and scale to the values encoded in a 4x4 local-to-parent matrix.

This function gives identical results to the following operations, but is more efficient: AffineTransform.decompose(localToParentMatrix, out float3 position, out quaternion rotation, out float3 scale); transformRef.LocalPosition = position; transformRef.LocalRotation = rotation; transformRef.LocalScale = scale;


Declaration

public void SetLocalTransform(float3 position, quaternion rotation, float3 scale);

Parameters

Parameter Description
position The new parent-relative position
rotation The new parent-relative rotation
scale The new parent-relative scale

Description

Sets the local (parent-relative) position, rotation, and scale to the provided values.

This function gives identical results to the following operations, but is more efficient: transformRef.LocalPosition = position; transformRef.LocalRotation = rotation; transformRef.LocalScale = scale;