Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

Day 6:

Following my goal yesterday of integrating the dialogue pop-ups with player movement, I managed a clunky system that still needs debugging. To make the actual tiles in the 2D tilemap interactable, I am pretty sure I will need to use ScriptableObjects and create a custom class for these types of tiles. I didn't have time to go through that in detail, so instead my hacky solution is to create GameObjects for each interactable tile that is in the same position as the tile sprite itself. Then, in my movement, I check what direction I am facing, and if I press SPACE to interact, I find the position of where I'm facing and see if it matches any of the interactable objects. If so, the dialogue pop-up appears!


That's the gist of it, but some bugs appear because I am using the same command (getting keyboard input for the Space) to trigger an interaction but also the same command to go to the next text panel of the dialogue pop-up, which can skip the text panels.

I'm probably just thinking of these the wrong way, but do you know of a way to add a component to a tile? I assumed that's how tile colliders would work, but either you can't put components on a tile or I had too much to drink that night.

Yeah that's what I was trying to get at in my update - to add components for a Tile, I think we need to create a custom SpecialTile class. Unity has a live training video on ScriptableObjects for this purpose, but it was an hour+ and I didn't have time to watch it, so that's why I'm taking my hacky approach instead.

(+1)

Ah, gotcha. I should have a couple hours tomorrow morning before things get crazy, so I'm going to try and figure out how we're supposed to do this, if there is an intended way.