Check if a part is in camera's viewport

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I am trying to code in a flashbang using the realistic flash effects module (link here)

  2. What is the issue? Include screenshots / videos if possible!
    I want to only flashbang the player if the player is looking at the part (the red part in this example)

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have only tried searching the devforum but I couldn’t find a result

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local flashmod = require(game.ReplicatedFirst.Flash)

wait(5)
print("flashing")
--placeholder code, no idea how to do the condition for this
flashmod.new(10)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

Hello!
Thank you for using my Realistic Flash Effects module!

If you’d like to detect whether a part is visible on the player’s screen, check out the WorldToScreenPoint.

Let me know If you need anything else :pray:

1 Like