Announcement

Collapse
No announcement yet.

Getting click information on static mesh

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Thanks for the help, i have to admit, i felt stupid when i realized how easy it was to get hit location, i used "GetHitResultUnderCursorByChannel" and then "BreakHitResult" to get the magnitude and normalized version of the vector between the hit collision and the planet origine (god this was a long time ago i last worked on vectors).

    Now I would like to prevent some areas of the planet to be interacted with sometimes but not always (mostly water parts of the globe)

    What are my options to do that ? is there a way to kind of draw/brush areas over my static mesh or maybe should i use 2 of them, one for the water part and one for the continents only ?
    Last edited by Ldle; 01-04-2016, 09:45 PM.

    Leave a comment:


  • replied
    You need to decide what kind of coordinate system you want.

    If you take the hit location of any trace to the planet, and then subtract the planet's center location and then normalize that value, this will be an accurate 3d coordinate that can be used to index back to a location on the planet.

    You could define this many ways. You could convert the 3d vector into an octahedron or equirectangular coordinate system and then simply break up your world like 2d grids on a map.

    Or you could simply cover your planet with 'areas of interest' and for any hit, iterate over all of the areas of interest and find the closest one and just assume the player clicked that. That is probably the simpler approach to start out with, but the above approach would be potentially more expandable, although you'd still need some way to define the areas of interest. I would probably make an array the size of the number of grid cells and assign an index for each grid that says what the area is. It could be a simple enum index or an index into other blueprints or anything really.
    Last edited by RyanB; 01-04-2016, 01:31 PM.

    Leave a comment:


  • started a topic Getting click information on static mesh

    Getting click information on static mesh

    I have a sphere (planet) and would like to make it so when i click on it that i get some kind of information back to where exactly i clicked on the sphere.

    I need to use some kind of coordinate so i can manipulate objects rotating around the planet and user interaction with it.

    Is there a way to do so ? I don't think or at least didn't find a straight way to do it, so what kind of trickery should i employ to get what i want ?

    Additional information: the planet won't be moving, no translation nor rotation, the camera will be rotating and zooming in/out around it.
Working...
X