How do I find name/id of physics Fixture in DnD mode?

Director_X

Member
Hi. In physics Drag-n-Drop mode, we can easily assign a fixture to an object via Modify Collision Shape just by creating some coordinates.
But where do we see what it is called? I don't find it's name/id anywhere?!
fixture.JPG
I need the name/id to be able to manipulate any interaction with it.

Thanks. :)
 
Last edited:

Director_X

Member
Any ideas?

I know the ability to SET/GET_id/name exists in GML (I dont use this method as we have to manually define each coordinate for any specific sprite shape = tedious).

But how do I find what the ID/name of the fixture is in DnD mode?

Thanks.
 
Last edited:

Jezla

Member
I don't think there is any way to get the id of a fixture created via the object editor. I'm not familiar with DnD, but there isn't even a gml function to get a fixtures id. I usually recommend that if you expect to change the physical properties of an object's fixture, you define the fixture in code, so that you can store the id in a variable to refer to later. Modifying the collision shape in the object editor is best for simple physical objects.

I haven't done anything with GMS since before 2.3 came out, so it may have been fixed, but there was a bug with the object-editor defined collision shapes, so that they wouldn't work, necessitating that all fixtures had to be defined via code anyway.
 

Bart

WiseBart
I'd say the same from my experience working with this.
It doesn't seem like the fixture that you define in the Object Editor can be accessed through code. It looks like it is managed by GM internally.
It is a very quick and easy way to add physics to a game but if you need anything more than that it has to be done through code.

As some kind of workaround, if you do want to use something in the editor that has a similar look and feel, you could use Object Variables.
In the Create event you then create fixtures based on the values in those variables and bind them to the instance using physics_fixture_bind. If you use a parent object you'll only need to write that code once.
(make sure to clean everything up afterwards since you'll have to manage everything yourself from here on)
In the end it will almost work the same.
 

knightshaft

Member
But how do I find what the ID/name of the fixture is in DnD mode?
If you already know the GML you can add an "execute code" block and use GML.

I started my game in DND but it is now plastered with code blocks becuase the advanced features are not available in DND. At some point I will convert the lot!
 
Top