Xilexio

  • Content count

    7
  • Joined

  • Last visited

Community Reputation

2 Neutral

1 Follower

About Xilexio

  • Rank
    Junior Member
  1. tl;dr: You compare exactly floating points, resulting in weird behavior. When the player goes upwards diagonally, the character sprite is directed either upwards or to the left/right. This is inconsistent. More specifically, if (inst is the player) (inst.Transform:GetRotation() + TheCamera:GetHeadingTarget() + 360) % 360 falls between 135 and 225, it shows facing upwards, if inst.Transform:GetRotation() is non-negative. If it is negative, it faces upwards if (360 - inst.Transform:GetRotation() + TheCamera:GetHeadingTarget() + 360) % 360 falls between 135 and 225. The problem is that while camera rotation is exactly 0, 45, 90, etc., the player rotation is always off by a fraction of a degree. It was important for me, because I am doing a mod, where I want the beard to appear only if the sprites are in the upwards position, so I need to detect when the player is shown going upwards relatively to the camera.