Jump to content
  • 0
Sign in to follow this  
Igor Q.

Find Y value of terrain

Question

Hi 

I would like to have a function that finds the highest Y value of the terrain.

 

For example, I want to spawn an item dropped on the ground (random location), however because terrain height varies...its difficult to do this because it either floats or is buried into the ground.

It can also be useful for... Generating plants and trees, teleporting players, getting reference points, etc.

 

I would invision it like.

Input<<X<<Z;

Output>>highest Y value of terrain for (X,Z)

Edited by Igor Q.

Share this post


Link to post
Share on other sites

2 replies to this bug / suggestion

Recommended Posts

  • 0

Hi, there will be some "raycast" instructions in the feature. (probably something like Raycast (Origin <Vector> Direction <Vector> Filter terrain <bool> Filter building blocks <bool> Out hit posiiton <Vector> Out hit entity <Entity>))

Your request is possible to specific. (what should be returned when caves are on the specific location/floating platforms? should it take into account only terrain or building blocks? etc.)

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 0

In all honesty I don't think its worth the man power to invest in overly complex functions for ray casting.

If I needed something quite lucrative, the simplest solution would be

1) Toggle terrain/block/plants/water detection, etc 

2) Toggle X-ray (will return multiple values each time #1 is triggered as an array from closest to farthest)

Edited by Igor Q.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×