Khaligufzel / Dimensionfall

A survival game inspired by Cataclysm: Dark Days Ahead and Bright Nights.
MIT License
12 stars 5 forks source link

Player can grab items in a container trough walls #113

Closed snipercup closed 4 months ago

snipercup commented 4 months ago

When a player is standing close to a container and there's a wall in between, like this: image

The player can still access the items trough the inventory menu: image

We need some way to detect if there's a wall between the container and the player. My idea is to use Helper.map_manager for this. When the player's itemdetector detects a container entering it's proximity, we ask the map manager to check if there is a block in the direction of the container. If there is, then we consider the container to be outside of proximity.

Khaligufzel commented 4 months ago

When the player's itemdetector detects a container entering it's proximity

Then I would use a simple ray cast to check if there is a wall/object in the way, I think that could be easier!