Hey all. Loving Godot 3.1 and the C# stuff.
I'm writing a platformer (using MMX sprites to get everything feeling right for now) and am trying to do shooting. I instance a bullet and shoot it from my global position. However, my global position continues to shift and change the further I get from the origin, to the point where my shots instance inside of walls.
Here is a video of it:
Here's the relevant code:
var shot = Assets.I.PLAYER_SHOT.Instance() as PlayerShot;
var pos = this.BodyShape.GlobalPosition;
shot.GlobalPosition = pos;
shot.Direction = this.FacingRight ? 1 : -1;
I tried this.GlobalPosition as well, but no difference. My position gets farther and farther off the more I travel from (0,0) and then gets closer when I am closer. But, my collision boxes are still working and everything else is still interacting correctly. I tried calling this function before and after MoveAndSlide() with no difference in my position being noted (and the bullets still coming out of my feet or materializing in walls).
Any ideas on why my GP is so whacked?