Why are my instanced static meshes only visible in the viewport?

I’m trying to add foliage inside a blueprint so I created a script in blueprint to procedurally add instanced static meshes using line trace.

In the viewport it looks like this:

but in the level editor or when playing the game, no instanced mesh are visible:

I’ve been looking everywhere and I can’t seem to find the reason why the instanced meshes are not showing.

Is there anything I need to set before using instance meshes?

Found out the problem:

https://scontent.fymy1-2.fna.fbcdn.net/v/t1.15752-9/43185947_174129110134193_8237902279097712640_n.png?_nc_cat=100&oh=32c235844cc53cf66c7ef56c59eeb835&oe=5C586B10