Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefabs not spawning on GameManager #2

Open
Gizmotronn opened this issue Oct 27, 2021 · 0 comments
Open

Prefabs not spawning on GameManager #2

Gizmotronn opened this issue Oct 27, 2021 · 0 comments
Assignees
Labels
bug Something isn't working pcg Procedural Generation

Comments

@Gizmotronn
Copy link
Member

As per the new function in TreeSpawner.cs:

    void SpawnTree(Vector3 position, GameObject[] availablePrefabs) {
        Vector3 truePos = new Vector3(position.x + (Random.value * MaxTreeOffset), position.y, position.z + (Random.value * MaxTreeOffset)); // Actual position of each prefab that will be spawned in
        GameObject treeObj = Instantiate(availablePrefabs[Random.Range(0, availablePrefabs.Length)], truePos, Quaternion.identity);
    }
}

Trees (which is the current demo option) should be spawning when running the GameManager - but they're not

This is what should be happening:
Screen Shot 2021-10-27 at 11 00 12 pm

At first I was thinking that there was more wrong with the current iteration but then I realised the seed and wave maps are just different, so the terrain is obviously going to be composed of different biomes. We just need to figure out why these prefabs aren't spawning on top - and then we need to figure out how to interact with the prefabs (as when the game ends, the prefabs disappear and will then be regenerated in a different PCG iteration).

This is what we've currently got:
Screen Shot 2021-10-27 at 11 14 08 pm
On the left we've got a height map with "island" configuration, on the right we've got a general biome setup.

Also in the above image, we see the ground material in the bottom right of the inspector which can be used in a similar role to this:

-L

@Gizmotronn Gizmotronn added bug Something isn't working pcg Procedural Generation labels Oct 27, 2021
Gizmotronn added a commit that referenced this issue Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pcg Procedural Generation
Projects
None yet
Development

No branches or pull requests

3 participants