This unofficial project of mine was made to try to recreate fighting game mechanics. So far I have a Ryu player sprite with a working state machine, collision box that changes based on the playing animation, and inputs that support controller and WASD inputs.
[2:54 PM]
The only problem is that when I add two Ryu in the game (who both have different ID#s for input purposes) they share a collision box. This is most noticeable with collision box set visible and when crouching, in which case the collision box shrinks and snaps back to idle size, making the player hover above the floor.
[2:57 PM]
Making the box unique and other attempts at fixes has not changed this outcome. I want to let a fresh pair of eyes take a look at it and see if they can identify (but mostly fix) the issue for me. GitHub link is in the description below. And feel free to use the code for you're own projects as well if you are interested.
[2:57 PM]
https://github.com/MisclickKing/Fighting-Game-Prototype--Godot-4.0-
Fighting Game Prototype - Dual Ryu Matchup Shares Collision Boxes
Megalomaniak added the Godot 4.X tag .
- Best Answerset by Misclick_King
SOLVED! So, the problem was that I had the collision shape in the animation player.
To specify, this was the shape itself, and not the shape:size.
Once that was removed and the collision box was set to local_to_scene, the two character instances stop sharing the same collision shape frame by frame.
Shoutout to "Balthamel 9" and "Nisovin" on the Discord community server. Would not have figured it out on my own.