GameMaker Default fixture access?

V

Venomlemon

Guest
Hiyas,

I am new with the Gamemaker (currently using GM2 beta). There's something I wasn't able to find answer for with Googling, manual or researching old forum posts. Here it goes:

I assume fixtures contain both: attributes for physics (density, angular damping, etc.) and a bounding box. If so, there already is an existing fixture for a object since I've defined object to use physics and it already has all this information with in it.

Is there way to access this default fixture via code? To be more precise I need to have access to whether the object is sensor or not at any given time. Possible without making a new fixture by code?
 
V

Venomlemon

Guest
Here's an example what I mean:

physics_fixture_set_sensor(fixture_name, 1);

What should I write instead of "fixture_name" to access the default fixture already within the object?
 
T

Transcriptase

Guest
Edit: this is my understanding for GM:S, not GM:S2

I've been trying to figure this out too.

From what I've deduced so far, there seems to be no variable to access an object's fixture if it was defined using GM:S interface by checking the "Uses Physics" box in the object editor. The way to do it is to:
  1. Create a non-physics object in a physics-enabled room
  2. Create a temporary fixture
  3. Bind the temporary fixture to the object, saving the return value fixture as an attribute of the object
  4. Delete the temporary fixture
Unfortunately, step 3 above doesn't work for me, and I've submitted a bug request.

However, you don't need to do these steps if you're only concerned with angular damping, as there is a get/set attribute: phy_angular_damping.
 
Top