Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Detecting when entity is off screen doesn't work?

Featured Replies

I need to figure out when a ped is not visible to the human player on their screen. I'm not talking about whether the player's ped has a line of sight to the ped, I'm talking about are there any pixels being displayed at this moment which belong to the ped. 

I would've thought the Entity.IsVisible or Entity.IsOnScreen properties would've done the trick, but both always seem to return true. 

Is there any way to do this? 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Did you try the native IS_ENTITY_ON_SCREEN? From the nativeDB: "Returns true if the entity is in between the minimum and maximum values for the 2d screen coords. 
Still returns true even if the entity can't be seen yet is between the appropriate 2d screen coords (like above)." So it looks like it only detects if it is out of screen horizontally.

If that doesn't work you could use World.ConvertWorldPositionToScreenPosition() and check if it is inside the resolution rectangle, I haven't tried it but I think it should work.

  • Author
14 hours ago, alexguirre said:

If that doesn't work you could use World.ConvertWorldPositionToScreenPosition() and check if it is inside the resolution rectangle, I haven't tried it but I think it should work.

This seems to be working. Thanks. 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.