Seeking Solutions for Implementing Elevation (height) and Line-of-Sight in a 2D Topdown Space in Unity3D

746 views Asked by At

Description of Application

I am developing a 2D topdown game in Unity (C#) which uses a 2D image as the base terrain and every other object in the game space are also 2D sprites placed on top of this base terrain, with their own colliders and scripts governing movement and other behaviours.

Requirements

  1. Game objects moving over the base terrain must know their altitude
  2. Game objects must have their line-of-sight blocked by terrain features that are higher than their current altitude
  3. Characters must be able to throw objects like rocks that bounce off objects or row down slopes
  4. Using guns, characters must be able to shoot at targets and have the bullets traveling at different trajectories towards their targets.
  5. In the editor, allow the developer to place new terrain objects on the base terrain image and these should also be taken into consideration by the elevation and LOS calculations.

Problem

I am having difficulty implementing such elevation on a flat piece of image (that has other game objects with images sitting on top of it) and at the same time calculating line-of-sight, bullet trajectories and the rock-rolling-down-slopes physics that I mentioned above.

I'm curious to know if anybody has experience with or knows of any good techniques to solve this problem?

0

There are 0 answers