follow(obj: GameObj | null, offset?: Vec2): FollowComp

Follow another game obj's position.
const bean = add(...)

add([
  sprite("bag"),
  pos(),
  follow(bean) // Follow bean's position
])
``````js
const target = add(...)

const mark = add([
  sprite("mark"),
  pos(),
  follow(target, vec2(32, 32)) // Follow target's position with an offset
])

mark.follow.offset = vec2(64, 64) // Change the offset
kaplay logo

Misc