Use HISM to place meshed on landscape?

Hi all, I have a blueprint that is generated grass as a HISM that I want to automatically place upon a landscape, so I’m using a line trace to detect the landscape and then move the mesh there…unfortunately the whole HISM actor moves to that location, not each individual grass mesh. I am using a HISM because I need to bake in some interaction between player and grass. Please let me know what I’m missing here!

Hello! Just take a look: Add Instance is returning instance index, also you have got UpdateInstanceTransform. Just pass index from first one to last )

Hi, adding to the comment above, SetWorldLocation with the HISMC as input will move the whole component, not an individual instance. So you need to use UpdateInstanceTransfrom as described in the comment above, or directly use the correct transform when using AddInstance.

Also keep in mind that pure functions will reexecute every time you call them, so where you’re using GetRandomFloatinRangeFromStream and MakeVector afterwards, you’re using it 3 times, so you will get three different random values, not the same random value three times. If you want to have the same random value, save it it to a (local) variable once and then use it those three times from that.

Hi thanks for the response! BPs are not my forte, so I added in the update instance transform and moved the for loop index into the instance index of update transform. Am I missing something else?

Yes I see now about the SetWorldLocation, I’m glad you were able to point me in the right direction. I believe I am still missing a node because I am not getting the meshes to move. I will look into the stream comment as well, for now I’m not so worried about the randomness! Thanks again!

Connect AddInstance output return value and UpdateInstanceTransform input Instance index - that will be correct.

No luck so far :frowning:

Just have checked that on 4.23 - AddInstance and UpdateInstanceTransform work as expected. Can you check them without all this complex logic, just AddInstance and UpdateInstanceTransform? Maybe we miss something in all this linetrace logic…

Hi isn’t the point of the Linetrace to place the HISMs? How can using just add instance and updateinstancetransform move the meshes without an output from the linetreace?

I believe I am still missing a node
because I am not getting the meshes to
move.

You have set your z-position to 0…

If you meant to use the position of the impact point of your linetrace, then you will need to plug that into the UpdateInstanceTransform (and then also check WorldSpace) and not the MakeVector in the lower left corner of your images (where you have the z-position set to 0).

YESSSS! That was it! I completely missed the z position at 0. Thanks so much!