Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

putting bool's on individuell tiles

Discussion in 'Getting Started' started by killerKeks26601, Mar 23, 2021.

  1. killerKeks26601

    killerKeks26601

    Joined:
    Jan 13, 2021
    Posts:
    31
    Hello,
    I'm creating a farming game and setting up a function to instantiate Plants right now.
    The problem this function should only be called on a tilled field tile.
    Is there a way to put any behaviour, in this case just a simple bool, on a specific tile?
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Short answer: Yes, of course!

    Longer answer: You can set up your game to run any way you like. The only limitation worth considering is your own skill, design decisions, and preferences.

    To give you anything more specific, we'd have to know a lot more about how your game works. Are tiles entities that exist at this time? Do they have something that keeps track of their type and state? If so, it should be pretty straight-forward to add the functionality you're looking for.

    If you don't have tiles working in that manner yet, you've gotta sort that out before you can do the plant spawning thing.
     
  3. killerKeks26601

    killerKeks26601

    Joined:
    Jan 13, 2021
    Posts:
    31
    Sorry for the late reply,
    to answer your Question I am using the build in isometric tilemap that handles the tilemap all together.
    To give more context of what kind of game I'm working on.
    It is a isometric farming game like animal crossing or stardew valley.
    I will just create a manager object that stores an array of all tiles and work with that.
    I think that is what you meant.
    Thanks for the help either way.
     
    Last edited: Mar 25, 2021
    Schneider21 likes this.