I know that this, or something similar, has been asked before, but I've not been able to track down a simple solution to the problem, soooo...
My particular use case:
I have an exterior (3D) graveyard scene, which includes a church that can be entered. The church model is on an "Obstacles" Layer, which I use to prevent the camera from clipping through the scenery
When the player is outside I don't want her to be able to interact with things inside the church, and when she's inside I don't want her to be able to interact with things outside the church (even though in both cases she may be able to see those things - either through the windows, or through the doors when they're open)
At present I'm blocking hotspot access to the objects by using Interactive Boundaries. That more or less works, but it's not entirely ideal because it doesn't use line-of-sight, and in any case it's only really suitable for static objects
I've also just now introduced an NPC character into the equation, a monk who can walk randomly around the scene, and I only want him to be interactable when he can actually be seen by the player, so an Interactive Boundary isn't going to be suitable in his case
My feeling is that I'm going to need to write something to check if he's visible to the main camera, and switch his hotspot on and off, depending on whether he is or not, and perhaps that is the way to go; but this is such a standard problem that I feel it must have been encountered (and presumably solved) many times by other people before now, and that there should be a simpler solution which I just haven't stumbled on yet
So, any suggestions welcome
Comments