0

How should the findOne method be properly used? (http://wellcaffeinated.net/PhysicsJS/docs/#Physics-world-prototype-findOne)

This code returns the error: Uncaught TypeError: Cannot read property 'label' of undefined

var theBall = world.findOne([{ label: ball }];
Steve
  • 3
  • 2

1 Answers1

1

I think it does not expect an array but an object: world.findOne({ label: ball });

MiMo
  • 11,793
  • 1
  • 33
  • 48