Spawning items on one layer

Hello! I am trying to implement a system for item spawning in my game but , at the same time i am confused. How do you make a certain actor spawn randomly on only ONE layer of your game? for example the ground layer is were I want some food items to spawn.

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Place the spawner (the actor that is spawning the food items) on the layer you want the food items to be spawned to.

  • YourFace710YourFace710 Member Posts: 13

    Thanks @Socks , any way i could randomize the items being spawned? or would separate spawners for that?

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @YourFace710 said:
    Thanks Socks , any way i could randomize the items being spawned? or would separate spawners for that?

    Do you mean randomise which items are spawned ? (rather than randomise where they are being spawned or when they are being spawned . . . etc).

    If so . . .

    . . . . . . . . .

    Make an (integer) attribute in the spawner, let's call it Food.

    And let's assume you have 7 food items.

    . . . . . . . . .

    In the spawner, place a change attribute behaviour that says:

    Change Food to random (1,7)

    . . . . . . . . .

    Then under that some rules:

    When Food = 1

    Spawn Tomatoes

    When Food = 2

    Spawn Blueberry Pie

    When Food = 3

    Spawn Chicken McNuggets

    When Food = 4

    Spawn Sushi

    When Food = 5

    Spawn Beer !!

    When Food = 6

    Spawn More Beer !!

    When Food = 7

    Spawn headache tablet x2

Sign In or Register to comment.