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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Misplaced Instanced Static Mesh

I wasn't quite sure what to name this as the issue is rather peculiar to say the least. I've made a generator which generates a grid of instanced static meshes(using the hierarchical one so I can use the cull distance later if needed).

However, there is always one instanced static mesh that is misplaced, put inside my "walls". I've gone through my math several times and it shouldn't be happening. What's even more peculiar is that sometimes it will randomly disappear when that one instance goes out of view.

Also, if I enter debug camera mode - it will disappear right away. Any ideas as to what might be going on here?

I'm on 4.12.3.

Video Example: https://streamable.com/ms60

The grid of interest is the green one at the bottom left.

Product Version: UE 4.12
more ▼

asked Jun 25 '16 at 03:12 PM in Bug Reports

avatar image

22 9 10 15

avatar image Adam Davis STAFF Jun 27 '16 at 07:34 PM

Hi Dealman,

  • Can you show me a screenshot of how you are populating your instanced meshes?

  • Are you spawning the meshes at runtime or in the construction script?

  • What steps can I take to reproduce this on my end?

avatar image Dealman Jun 28 '16 at 12:22 AM

It's rather large so I couldn't fit all of it, but I could get what should be relevant. alt text

This function is executed using the BeginPlay event.

I'm not quite sure as to how you would go about to re-produce this issue, really, as I've no idea what's causing it. The fact it disappears when I enter debug camera makes it seem like it's some bug with the rendering of instanced meshes...?

avatar image Adam Davis STAFF Jun 28 '16 at 06:56 PM

Have you tried running this in the construction script instead of on begin play to see if there is a difference? Additionally, try adding a check before mesh placement for another instance in the location being placed to see if that causes the issue to halt. I don't think the walls portion of the script is going to be the problem, it looks more like a green cube is being placed after the fact, which could happen if it is not checking for a tile that is already placed first.

avatar image Dealman Jun 29 '16 at 03:33 PM

Hey, sorry for the delayed response. I tried hooking it up using construction script instead and I see the same results.

However, whilst in the viewport it looks fine. alt text

It still behaves the same, upon entering debug camera the instance is instantly removed.

I don't think it's an instance being wrongly placed as it's removed as soon as I enter debug camera mode or the grid going out of view.

If necessary I can provide you with the project or alternatively the .uasset file(s) themselves - whichever is more convenient for you*(it's hasn't got any significant content yet, so it's relatively small)*.

Also a quick off-topic question; are there any performance differences to using construction vs BeginPlay? The reason I went with BeginPlay is due to the editor generating the entire grid every time I compile it, which got a bit annoying after a while.

avatar image Rudy Q ♦♦ STAFF Jun 29 '16 at 05:24 PM

Hello Dealman,

If you would like to provide the project so that we could take a closer look, you could do so here or in a private message to me on the forums. This can be done with a google drive or dropbox link.

Additional information for the second question:

The performance difference would be that, all of the grid generation would be done ahead of time when using the construction script. This will take more memory up front and less taxing at runtime. On the other hand, if you use begin play this will mean that the grid is made at runtime. This means that it could have an impact on performance during generation depending on complexity.

avatar image Dealman Jun 29 '16 at 11:11 PM

I've sent you a PM with the project files. Hopefully y'all might be able to figure out what's going on. :)

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

1 answer: sort voted first

Hello Dealman,

After taking a look at your project it appears that your issue stems from the "Empty spaces" that you are providing to the instanced meshes. If you run a check to see if the vectors that are given are within the "emptyGridVectors" array, you will find that some of them are not within the array. I have provided an example below on how I was able to workaround the issue. You could use this method if you want, however you may want to take another look on how you are placing your instanced meshes. I hope that this information helps.


In this example I check to make sure that the values that are passed to the instanced meshes for their location are within the array. This is done by making sure that find item does not return a -1.

alt text

Make it a great day

more ▼

answered Jun 30 '16 at 02:13 PM

avatar image

Rudy Q ♦♦ STAFF
47.4k 545 132 523

(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