Jump to content

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


Recommended Posts

Posted

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?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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