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

PhysicsJoint.SetCallbackTarget

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 static int SetCallbackTarget(ReadOnlySpan<PhysicsJoint> joints, Object callbackTarget);

Parameters

Parameter Description
joints The joints to set the callback target on.
callbackTarget The callback target to set on every joint, or NULL to remove it.

Returns

int The number of joints that were ignored (not set because the joint was invalid). A single warning is logged when any are ignored.

Description

Set the same Object that event callbacks will be sent to on a batch of joints. Each joint is assigned the callback target as PhysicsJoint.callbackTarget would, and setting it to NULL removes it.

This is faster than setting PhysicsJoint.callbackTarget on each joint.