1
Ask a Question / Re: Getting the mass of an actor.
« on: August 01, 2011, 03:27:37 am »You actually can get the mass, you just have to use a code mode block:Code: [Select]_myAttribute = actor.getBody().GetMass();
where "_myAttribute" is the internal name of a number attribute in your behavior.
Thanks for reply, i fiddled the code and managed to create it so that it automaticly gets the mass, without having to set up an attribute for each actor separately.
Code: [Select]
for each(var actorInRegion:Actor in getActorsInRegion(_AntiGravity))
{
if (actorInRegion ! = null && !actorInRegion.dead)
{
actorInRegion.pushInDirection(270, actorInRegion.getBody().GetMass()*200);
}
}