x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to "Get texture at location" on landscape?

Hey, I would like to get information about which texture is used at a specific location of a landscape.

So I want to be able to know whether there is grass or dirt or anything else. It should be used for letting the player place certain buildings only on ground where for example is grass or stone. You know, you cant really place a farm on stone, while you also cant place a quarry on dirt.

I don't want to have to place other objects in the editor for marking where specific "resources" are, because it would be a pain to really keep this synchronous with the applied texture to the ground. It should really just depend on the texture.

How can I do this? Any help is appreciated :)

Product Version: Not Selected
Tags:
more ▼

asked Jan 04 '15 at 03:37 PM in Blueprint Scripting

avatar image

John Alcatraz
1.3k 60 139 127

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Not sure if you need exactly texture, but you should be able to receive physical material when raycasting against landscape. You can set different physical materials per landscape layer (dirt, grass, stone etc).

more ▼

answered Jan 07 '15 at 09:46 AM

avatar image

ddvlost STAFF
1.3k 18 7 48

avatar image John Alcatraz Jan 07 '15 at 03:53 PM

If I could set different materials per layer, that would be great, then just receiving the physical material would work, but if two materials would overlap (which happens quiet often on landscape) which one would the trace return? And how can I set actual different materials per landscape layer? I only know I can set different textures for the layers all in one landscape material (which is returned by the trace).

avatar image ddvlost STAFF Jan 07 '15 at 04:04 PM

In landscape painting tool there is should be list of layers that landscape uses, you can create and set LayerInfoObject asset for each layer. LayerInfoObject has physical material property.

LineTrace should return physical material of most dominant layer at hit location.

avatar image John Alcatraz Jan 07 '15 at 08:32 PM

It works! Thanks!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question