Hi, I posted it in Android development but now I realised that problem occurs also on Windows so it’s not a problem of android.
One script does not work- it simulates a place of spawning items, every time it should be diffrent but it is the same always (in preview it did work).
I am sorry but I do not understand it at all.
First of all, shoudl I modificate first or second setup?
Than, should I delete all my nodes, or just change some of theme?
In which blueprint should I put stream and seed random streem?
Sorry for, maybe stupid, questions but I am a beginner. Whole game works, only this tiny detail does not
The first one won’t work because there is no equivalent node for Random Point in Bounding Box that uses a random stream, but you could manually create one that has the same effect. The random number generators always generate the same random number in a packaged game unless you use the “from Stream” versions. (As you can seed these).
edit: Here is how you could do it the first way, by replacing the Random Point in Bounding Box, though there could be an easier way:
There is now almost morning in my country so I will try the second screenshot tommorow.
But your first solution, according to my second setup doesn’t work It spawns items correctly but when the player loses and level restarts,they are spawned in the same places as in the first attempt. When I play in editor, in preview window, every restart is followed by a new spawning, every item is in a different place- that is my target. But when I am packaging it and open on andriod od as windows application my items are spawned in the same way always, every time I play the game.
I hope your secend solution will solve it, thank you very much for your help!
The second one should work, though I’m not sure why the first isn’t working for you, maybe make sure you are using a “Seed Random Stream” node, and not a “Set Random Stream Seed” node.
As I said I will test second idea tommorow due to extreme tiredness but I have one more qustion about this idea. It might be stupid
So, In the viewport of my spawn area I have a box collision and few spawn points in it. In your second setup there is no connection between this spawning area with spawn points and the spawning process. How will the game know, were to spawn the items? (it’s late and my English is not perfect so if it is hard to understand what i wrote i try to explain my doubts tommorow).
In your original blueprint you were using your SpawnArea object, and getting its relative location and Box Extent variables to control where things are spawned.
You can do that still in your current version:
The relative area is the same as the BoxCenter1 variable in your current blueprint, so you can get that from your SpawnArea actor. You can do it similarly for the Extent, you could add a Box variable to your SpawnArea actor, and then get it, in your function.
Haven’t done in yet because I am still not sure how to setup all these variables etc, I try to do it with trial and error method but so far it spawns all the items in one place- the center of scene,
All items now are spawned in one xy location, only z differs what makes a tower in a center of my spawn area
Here are the screenshots, do not care about the names- dobry and zly means good and bad in my language what refers to the action that follows picking up an items
And I still have “set spawn points function” should I delete it? Can it affect a simulation? Because I wold leave it in case of returning to first idea with some new items I am going to create in future.
Your attachment didn’t work, however I notice you haven’t connected things right, it should be Relative Location minus Box Extent. You have them reversed.
You are also setting your box extent to 0,0,0.
It should be set to whatever size the spawn area should be, those are its dimensions. If it’s 0,0,0 everything will spawn in one space
It does not work
As always. Preview works fine. Everytime I restart game the spawning is different. After packaging, none restart changes anything. Items are spawn everytime in same way