Jump to content

Check if an Entity is visible on the screen (isVisible()) not working


elbojoloco

Recommended Posts

Hi,

In my code I use this simple piece to check if an entity is visible, if not, rotate the screen so it becomes visible:

 

if (!vein.isVisible()) {
  log ("Vein is not in screen, rotating camera...");

  if (getCamera().toEntity(vein)) {
    log("Turned into view");
  }
}

However even when the vein is not visible, it is still returning true and doesn't rotate the camera, is there any other way to check reliably?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...