Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetTransform

Set the Transform position without causing a PhysicsEvents.TransformChangeEvent to be generated by default. See PhysicsWorld.RegisterTransformChange.
Read time 1 minuteLast updated 11 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule

SetTransform(Transform, Vector3, bool)

Set the Transform position without causing a PhysicsEvents.TransformChangeEvent to be generated by default. See PhysicsWorld.RegisterTransformChange.
public static void SetTransform(Transform transform, ref Vector3 position, bool transformChangedEvent = false)

Parameters

transform

The transform to change.

position

The global position to set the transform to.

transformChangedEvent

By default, no transform changed event will be produced however this behaviour can be overridden with this argument.

SetTransform(Transform, Vector3, Quaternion, bool)

Set the Transform position and rotation without causing a PhysicsEvents.TransformChangeEvent to be generated. See PhysicsWorld.RegisterTransformChange.
public static void SetTransform(Transform transform, ref Vector3 position, ref Quaternion rotation, bool transformChangedEvent = false)

Parameters

transform

The transform to change.

position

The global position to set the transform to.

rotation

The global rotation to set the transform to.

transformChangedEvent

By default, no transform changed event will be produced however this behaviour can be overridden with this argument.