Jawad Amjad
Jawad Amjad

Reputation: 2552

Setting Friction Dynamically in AndEngine Box2d

is there any way to set the friction of a physics body dynamically in (AndEngine Box2D)

Upvotes: 1

Views: 933

Answers (1)

JohnEye
JohnEye

Reputation: 6895

Try this, I think it should work

body.getFixtureList().get(0).setFriction(x);

In the original Box2D, the friction is cached and you need to call world.Refilter(Shape). There is no such method in the physics extension of AndEngine so I hope it will work. It may not, though.

Upvotes: 1

Related Questions