Spawn on layer - XXX.LayerName

0 favourites
  • 4 posts
  • Hello fellas.

    So I am going through some capx from assets and engines made by users to learn how they do some stuff and I encountered this code quite a lot.

    Basically when the dev wants to spawn something on the player does this code:

    player is the player box/hitbox.

    Spawn whateveryouwanttospawn on layer player.LayerName(imagepoint 1).

    Excuse me if I sound silly but normally if you use this event you will have to select the layer you want to spawn it but I'm guessing this is some code to use the event in your favour and actually spawn it on the player itself? I'm kinda confused. He does this quite a lot

    Thanks for the help in advance

  • Yes it will spawn the object on the layer that the player is on at the time the event is triggered. player.LayerName is the current layer that the player is on.

  • Yes it will spawn the object on the layer that the player is on at the time the event is triggered. player.LayerName is the current layer that the player is on.

    Thanks! So I guess this is a smart way to use this call right? Would you suggest such a thing?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • it is useful. it will allow you to spawn something on the same layer as the player without creating additional logic to find out what layer the player is currently on, if you know what I mean. The info is already stored in 'player', or whatever the object is.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)