• Announcements

    • JanH

      Rhymes with Play Dev Cast - Ranching Upgrade Mark I Launch   03/21/2018

      Join us on our Twitch channel on Thursday, March 22nd, 2018, where we will be playing and discussing Oxygen Not Included: Ranching Upgrade Mark I for the update's launch. Don't forget to click on the follow button on the Klei Twitch channel to get alerted whenever we go live. As always, the Rhymes with Play dev streams are live Thursdays at 3:30 PM PST (10:30 PM UTC) Where is it?
      https://www.twitch.tv/kleientertainment You can also watch the stream live on the Oxygen Not Included Steam Page! Use our handy widget below to see when the stream goes live in your area: Check out the stream announce thread for discussions!


  • Content count

  • 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.