Skip to main content
Version: Phaser v4.0.0-rc.6

Types.GameObjects.PathFollower

PathConfig

<static> PathConfig

Settings for a PathFollower.

nametypeoptionaldefaultdescription
durationnumberYes1000The duration of the path follow in ms. Must be > 0.
fromnumberYes0The start position of the path follow, between 0 and 1. Must be less than to.
tonumberYes1The end position of the path follow, between 0 and 1. Must be more than from.
positionOnPathbooleanYesfalseWhether to position the PathFollower on the Path using its path offset.
rotateToPathbooleanYesfalseShould the PathFollower automatically rotate to point in the direction of the Path?
rotationOffsetnumberYes0If the PathFollower is rotating to match the Path, this value is added to the rotation value. This allows you to rotate objects to a path but control the angle of the rotation as well.
startAtnumberYes0Current start position of the path follow, must be between from and to.

Type: object

Member of: Phaser.Types.GameObjects.PathFollower

Source: src/gameobjects/pathfollower/typedefs/PathConfig.js#L1
Since: 3.0.0