[BUG (and fix)] Incorrectly Drawn View Angle Gizmo in CanSeeTarget2d.cs

Forums 💬 NodeCanvas ⚙️ Support [BUG (and fix)] Incorrectly Drawn View Angle Gizmo in CanSeeTarget2d.cs

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16271
    the-simian
    Participant

      Short Version: you need to replace line 57 in CanSeeTarget2d.cs with this line, because the gizmo is pointing the view angle cone in the wrong direction:
      Gizmos.matrix = Matrix4x4.TRS((Vector2)agent.position + offset, Quaternion.LookRotation(agent.right), Vector3.one);

      Longer Version:
      Before changing the code the View Angle cone shoots out in the z axis, and is not representative of the actual cone. You can observe this when you view in 3d.

      The actual trigger is in the wrong area marked in file #2.

      The pasted code (thanks to @aFoolsDuty) corrects this.

      #16272
      Gavalakis
      Keymaster

        Thank you for posting the change here and of course thanks to @aFoolsDuty for being super helpful as he always is!
        I’ve made the change just now.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.