I'm a newb that needs some help with two-part/object characters. (In a Top-Down Game)

Gotcha. Your thoughts are in the right place, managing the torso and legs separately can definitely work and make it easier, but using multiple objects to manage them overcomplicates it in my opinion.

The reason being the way that objects work in GM and the problem you had trying to get multiple objects to line up pixel-perfect and frame-perfect without noticeable lag.

You can manage as many sprites as you want inside a single object, and when you draw sprites, it does it in reference to the object's origin.

In my example above, I'm drawing two sprites, both at (X,Y). One is the head, one is the body, and I'm doing this because I animate them separately which sounds like what you want to do.

When I tell the body and the head to draw at (X,Y) it is referring to the location of the player object in the room, the object calling the draw code. I move that object around to show the player that they are moving. So the sprites always draw exactly where the player object is, meaning both the head and the body follow perfectly without lag.

Now, when I tell it to draw at (X,Y), it lines up the object's origin with the sprite's origin. You can see each sprite's origin in my screenshot. Both are at the neck area.

If I told the head to draw at (X, Y - 1) then it would look like the head is hovering 1 pixel above the body at all times.

This is all extra, but I learned this by diving into the code of a project someone released. I would link the project but the download link is dead. I have one of the scripts to it, as well as the sprites, but I don't have the project in its entirety. What the project did was have a single player object that drew itself in, literally, like 10 different sprites. It layered them to give off the illusion of 3d.

Here's a screenshot of it in action. Note that this isn't mine.

The code to it is here: http://pastebin.com/2wNAK34B

It's made for its sprites, but I just wanted to show you just how much you could rely on a single object to handle your player's animating.

Unless the other object is a truly separate entity from the player and may need to calculate itself separately from the player, I wouldn't separate them as objects. An example of wanting to do that would be like your guns, if you wanted to be capable of throwing the gun itself at an enemy. Even then it's not 100% necessary and can be entirely contained in the player's object code.

Apologies, I went off on a tangent and probably hurt more than I helped :(

/r/gamemaker Thread