object:setTarget()

Type Function
Object Joint
Library physics.*
Return value none
Revision Release 2024.3703
Keywords joint, setTarget
See also object:getTarget()
Physics Joints (guide)

Overview

Sets the current target (follow) point of a "touch" joint in content space coordinates. This can be any specific content point, the location of the user's touch, the coordinates of some other object to follow, successive points along a path, etc.

Syntax

object:setTarget( targetX, targetY )
targetX, targetY (required)

Numbers. The target coordinates in content space.

Example

myJoint:setTarget( 100, 225 )