How would I find neighbours of a tile in a grid ?
Hello everyone, I am currently trying to create a small builder game. So I have arrived at a massive problem. SOLUTION CAN BE FOUND HERE !!!...
View ArticleGrabbing adjacent object references on a grid
Hi everyone. I started learning Unity early this year, and I am currently playing around with making 2D puzzle games. A couple of my projects incorporate a grid of sprite/image objects, and in my...
View ArticleTwo transparent cubes when placed adjacently have a dark face between them,...
guys, I am working on a project in which i want to spawn cubes with water like effects. I created a cube and attached a transparent material to it. After I duplicated that cube and put it adjacent to...
View ArticleHow do I check for adjacent tiles of the same type?
I am currently playing around with a project similar to the game Collapse.![alt text][1] [1]: /storage/temp/84823-screen-shot-2016-12-27-at-60849-pm.png This is my version of the grid that get created...
View ArticleHow to teleport to an adjacent empty?
How would I make it to where in 2D if I'm standing in a 3x3 grid made of empties with sprites attached to them, I move to the adjacent empty based on which axis I push (for example, if I'm standing on...
View ArticleOnly choosing the surrounding tiles on a checkerboard
I just asked a question regarding this issue but unfortunately I'm still having issues. I want to choose a tile and then choose another tile but only if it is next to the first tile chosen. I am...
View ArticleCheck if two objects are next to each other?
I have a checkerboard style prefab in my scene [see below] I would like to select a tile (which turns it red) then select another tile and only turn it red if it is next to the currently selected tile....
View Articleadjacent tiles within range
I made a script that highlights all tiles within a range. It works fine when it is far from the edges but it gives me " NullReferenceException: Object reference not set to the instance of an object" at...
View ArticleProcedurally Connected Mesh/3d Model Tiles?
On a grid-based game, how would I procedurally determine adjacent objects (North, South,East, West) in an efficient manner? I already have everything implemented from grid, to grid object placement, to...
View ArticleBCE0019: 'Add' is not a member of 'UnityEngine.Transform[]'
I need help with a problem I get in my code. I am writing a code to generate a maze using Prim's Algorithm. This is the code I get the error on: `function SetAdjacents() { var x : int; var y : int;...
View ArticleAdjacent Elevator is activated.
I have two elevators next to each other running the same script. They are very close to each other and this can't be changed in the level. The problem is I can open one of the elevators fine but if I'm...
View ArticleHow can I find an adjacent tile, if the tiles vary in shape and size?
Working on a risk-style game, need to be able to find which tiles a unit can move to, depending on which tile it is on, keeping mind that the tiles are countries/territories. Any ideas? Each territory...
View ArticleCube Morph to Adjacent Cube
Hey guys, I'm attempting to make a collectable terrain setup similar to minecraft. If you play minecraft, you'll understand. For you minecraft players, in minecraft the fences are a mere stump when not...
View ArticleAdjacency information in geometry shaders
Hello, I'm trying to play around with geometry shaders in Unity and I ran into one question that I can't find an answer to: **is there a way to pass/get adjacency information in a geometry shader in...
View ArticleFinding adjacent tiles in a grid
I have a 2D grid of tiles, and I need to build an array storing each adjacent tile of any given tile as a once-off operation. i.e. At startup, the adjacent neighbouring tiles for each tile are stored...
View ArticleIncorrect adjacent neighbors of a tile
**FYI:** "Tile" does not refer to Unity's Tile, but instead a GameObject with an attached MapTile script. I'm attempting to find adjacent neighbors (N, E, S, W, NE, SE, NW, SW) of a tile on game start,...
View ArticleHow do I check for adjacent tiles of the same type?
I am currently playing around with a project similar to the game Collapse.![alt text][1] [1]: /storage/temp/84823-screen-shot-2016-12-27-at-60849-pm.png This is my version of the grid that get created...
View ArticleHow to teleport to an adjacent empty?
How would I make it to where in 2D if I'm standing in a 3x3 grid made of empties with sprites attached to them, I move to the adjacent empty based on which axis I push (for example, if I'm standing on...
View ArticleOnly choosing the surrounding tiles on a checkerboard
I just asked a question regarding this issue but unfortunately I'm still having issues. I want to choose a tile and then choose another tile but only if it is next to the first tile chosen. I am...
View ArticleCheck if two objects are next to each other?
I have a checkerboard style prefab in my scene [see below] I would like to select a tile (which turns it red) then select another tile and only turn it red if it is next to the currently selected tile....
View Article