I was making a game that has a complex animation system and everything was going well, until I implemented a second player character.
My system works like this:
I only place the character's hitbox on the layout and at the start of the layout, the event sheet places all the body parts onto it.
Then, every tick, the position and angle of the body parts is updated. I don't use pins because the pins started lagging really badly once I daisy-chained more than one part.
Because I wanted my game to be dynamic and scalable, I used functions to implement the placing and the updating of each character's parts.
I have those 2 functions (stemming from one Function object, does that make a difference?), createCharacter and assembleCharacter, which are called with either 0 or 1 as their parameter, depending on which player they should affect.
The way that works is as follows:
The hitbox has an instance variable playerNumber that corresponds to the instance variables owner in the body parts.
For some reason, assembleCharacter places the pelvis (and thus subsequent parts) on the last called hitbox, even though I tell it to discriminate based on playerNumber and owner.
Here is the file:
I've removed almost everything that is not related to the problem. There may still be some residual behaviors and instance variables that shouldn't affect anything though.
I've also set the event sheet up so it is observable what is happening. In the first 4 seconds, the assembleCharacter function is alternately called with 0 and 1 as its parameter each second, after that both are called every tick.
I've been working on fixing this for close to 24 hours. I would be very thankful for any help.
Edit: I think I have enough reputation to post the file now.