Hi. I have a little problem because i want to make a system that randomly generates objects on terrain, but i can’t find any tutorials on it. i folowed this tutorial to spawn objects randomly(let’s say the objects are mushrooms in a forest)but it basicaly only works for 1 or 2 objects because if you add like 70 it will try to spawn them but when it selects the random number again it deletes the mushroom(or at least i think it does) because out of 100 objects i get like 30 and i see mushrooms disapearing when they spawn.i need to spawn the on the terrain but it has hills so i don’t think anything with triggers would work. (btw i work in blueprint only)
yes, i use the landscape tool
thank and i’ll try this as soon as i get a chance. just to be clear i need my mesh to spawn randomly every time it start the game will this do that?
are you using landscape tool of ue4? if yes, i got a fix for you.
if not you can use spawn actor from class for flat land easily (disappearing? what do you mean by that ? it is impossible ,i use spawn actor from class nearly 20 times a week, nothing disappear so far, and try using for loop)
not randomly (not sure) but will help in densely populating the area useful for grass works for meshes only for randomly placing actors on terrines i got another way but it is quit dumb but does the trick nicely but consumes time while loading which depends on terrines heights , i will not be recommending that to you.(it’s a stupid way i used ones but discarded later), a umg hides level while it builds and actor fall from sky without simulating physics and on hit they just settled there (stopped) and started simulating physics .
how did you get the (“sample” grass) node in the second picture?
landscape layer sample and for grass landscape output grass
just wright landscape you will get a few good options for landscape
i should not be sharing this one but i got this as a result(my grass is poor so ignore that, just see their number) reduce the grass density to get your wanted result
i just noticed your firs comment edit and i use an array and if i just do that every object is invisible
on the left there are target points
why are all of those mushrooms invisible. they turn visible only if i toggle their visibility(i click actor hidden in game and then disable that while simulating) manualy while simulating
There are a few reasons for this, I will try to make a short working setup and share it here with all the necessary information required regarding visibility specialy
is even one of the mushroom visible? because i think something is wrong with the get node(integer is set to 0? this will spawn everything on one the first location, )
the set up (2 ways are there for spawning)
the actor setup
the actors material was made for some reason i don’t remember but it is easy to identify it in my waste project’s (that’s what i call it; i use it to test new things) crowd.
the SETUP_1
- the level setup
- the result
(ignore the task manager and the surrounding (just focus on the cabbage-like-actor)
the SETUP_2
- the level setup
- the result
the conclusion :
setup 1 gives not so random and requires manual setup in level
setup 2: gives more random and more populated results but actors can be overlapping (you can fix that by changing overlap settings)
and for the mesh try deleting its collision (the meshe’s collision not actor’s collision)
Hope it help! if not feel free to ask (specially about visibility if not solved)
Thank you so much! everything works great but my landscape has a hill
so how would i be going with this?
well maybe use the one i mentioned erlier
" i got another way but it is quit dumb but does the trick nicely but consumes time while loading which depends on terrines heights , i will not be recommending that to you.(it’s a stupid way i used ones but discarded later), a umg hides level while it builds and actor fall from sky without simulating physics and on hit they just settled there (stopped) and started simulating physics ."
sure there is a better way…
got another way but requires you to add a box for collision(well you can use a component with tag to avoid other collision problems),
willing to do it?
spawn everything below slope
add a collision box in that level and in it it would collide with objects 'when that happens it would check that actor has tag and make it’s location add up (z) till it’s out of it’s collision
by collide i mean overlap’ sorry for confusion.
how could i make them fall without physics?
i would suggest the collision one but if you want that , it takes time during playing as they fall by using(collision one is fast as playing time is less consumed) add actor offset
keep refreshing the web page to see my replies , they don’t load until you refresh your web page/browser
i know but i have to work (i live in a farm) so i can’t check this very often
well, i can ,( making a video for my sister’s birthday using ue4 ; it’s not that easy as it seemed to me at start) when saving ,it says you need to close matinee , so while that happens i check these .my computer is 4 GB RAM so it’s slow at that(which place’s farm? where is LT? can’t figure out.)