Get an actor friction

dubealex

  • Posts: 26
Simple question, I tried to find it, quickly, in the API doc, did not find it, don't know if it exist.

I would like to know the code or function to get the current friction for an actor to use in a codeblock in a behavior. There's a setFriction function... I did not find a getFriction or did not know how to use it.

Thanks in advance

captaincomic

  • *
  • Posts: 6108
b2Fixture has a GetFriction() method.

To get the fixtures (collision shapes) of an actor:
Code: [Select]
var body:b2Body = _actor1.getBody();
for(var fixture:b2Fixture = body.GetFixtureList(); fixture != null; fixture = fixture.GetNext())
{
  //...do something with fixture
}