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"

Getting instanced static mesh component from actor

So I wrote a simple blueprint that constructs a building using 3 instanced static meshes, the meshes are: a cube, a glass cube and a half cube. Now I want to detect which of the 3 I hit with a line trace. I know how to get the index of a mesh, but not which mesh I hit. I tried using the "Hit Component" output of the trace but it is not compatible with "Instanced Static Mesh Component Reference" as it is a "Primitive Component Reference".

EpEp

Product Version: UE 4.12
Tags:
more ▼

asked Jul 15 '16 at 12:15 PM in Blueprint Scripting

avatar image

EpEp
6 1 3

avatar image Pinchinator13 Jul 29 '16 at 04:09 PM

Would also like to know how this can be done.

avatar image X-perto Jan 02 '19 at 02:03 PM

Have you found a solution to this?

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

It's been a while since I'v looked at this particular problem. From what I can remember it's not possible to delete one component of the instanced static mesh without deleting the whole. I might be wrong about this presently.

So I ended up using a voxel system that uses the procedural mesh component to generate the terrain, or whatever. And you can delete/add individual voxels. If you're not familiar on how to implement voxels then this is a good starting point. The tutorial is focused on terrain application, but the voxel system is the same for buildings and whatnot, you just use a building algorithm or manually input the voxels instead of using noise. The tutorial is a bit old, but I can confirm that it works with new engine versions, there are some bits of code that needs changing, but that's addressed in the comments section.

more ▼

answered Jan 02 '19 at 05:53 PM

avatar image

EpEp
6 1 3

avatar image EpEp Jan 02 '19 at 05:57 PM

Just read my question and it seems like this is not quite the one I thought it was, sorry. However what I said about voxels still stand, it seems easier to do it that way.

avatar image X-perto Jan 02 '19 at 06:38 PM

This answer is even better than what I expected, thanks a lot!

avatar image EpEp Jan 02 '19 at 06:41 PM

No problem, I sure was surprised to see a notification of my almost 3 year old question pop up :)

(comments are locked)
10|2000 characters needed characters left

Well, since people are still looking at this thread--and it just came up for me in a search for something else--I figure I might as well toss my solution on here in case anyone finds it useful. If I understand the question right, I think you just need to cast to the instanced static mesh, and in conjunction with "Hit Item" that should give you the specific instance that you hit. So, for example, you could remove the specific instance (and not the whole thing) like this:

alt text

more ▼

answered Feb 14 '19 at 04:56 AM

avatar image

RhyssPaces
1 1

(comments are locked)
10|2000 characters needed characters left
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