Object visability based on player positioning

I’m trying to figure out how to manipulate object visability based on the positioning of the player. For example if the player needs to cross a gap whether or not there is a bridge to cross depends on where the player is positioned. Any feedback on this would be greatly appreciated.

Thanks,
Hans

By visibility do you also mean whether or not the object will interact with the player/world or just visibility?

Both. If the player for example were to stand on the left there can be no visibility or interaction. If the player were to stand on the right there can be both visability and interaction.

You quastion is hard to understand “player need to cross a bridge”, but he will need to cross it either way regardless of position.

The bridge was an example. In a nutshell I want to be able to manipulate whether or not the player can both see and interact with an object based off of the positioning of the player.

Well you put check of distance between them at the gateway of interaction functions, you would need to explain your interaction system for farther help

I guess this would be broken into two parts visibility and interaction/lack thereof. The first part would be only achieving visibility from a certain location or direction of view. Ex: Stand to the right of the object is visible or stand to the left it isn’t. The idea is to create a sort of optical illusion. The second part is if you move toward the object from the position(s)/view where the object is not visible no interaction (boudaries) can occur. If the player were to approach the object from the position where the object is visible interaction can occur. Let me know if I need to explain something further.

You could make two trigger volumes on either side and when the player enters them just disable/enable all the actors functionality with the following functions:

  • SetActorHiddenInGame
  • SetActorTickEnabled
  • SetActorEnableCollision

I think that’s all the ones you need.