Thank you so much this guide was exactly what I needed !
@shaladddin5687
2 жыл бұрын
yo, you should add "Unity" keyword on the title bro the heck, this video deserves more than just 40 likes
@captainhamburgers8571
3 жыл бұрын
Whey got it working. Decent guide as far as they go this one. Specifying that you need to drag your specific tilemap and tile into the script variables on the main unity editor page would be handy. I can use this now to check if my character is hitting into certain tilemaps like pokemon/zelda just gotta replace Vector3 mp = Camera.main.ScreenToWorldPoint(Input.mousePosition); With> Vector3 mp = new Vector3(0f,1f,0f); and specify the coordinates off of my characters coordinates.
@histhoryk2648
3 жыл бұрын
Finally, this is what I was looking for
@Maxvellua
Жыл бұрын
Thank you for the video! It's all what I need!
@vizualwanderer
3 жыл бұрын
fast and simple, ThankYou!
@codenum2873
2 жыл бұрын
Thank you....it was exactly what I was looking for 😀😀
@karmamell2532
2 жыл бұрын
Wonderful, this is exactly what i needed
@amunichan1188
2 жыл бұрын
Thanks so much! Your video helped me a jam!
@christiankruse5069
Жыл бұрын
Thank you for a super helpful tutorial!
@blackflame_
2 жыл бұрын
Underrated channel
@daltonrinck3617
Жыл бұрын
thank you very much for this. helped me out a lot !
@atrejoprivate9541
2 жыл бұрын
Thank you soo much for the guid
@andreman2767
2 жыл бұрын
Awsome soundtrack for gamedev :)
@mr.condekua6141
2 жыл бұрын
Thank you!
@michaf5364
3 жыл бұрын
Thanks
@okamichamploo
Жыл бұрын
I'm curious. The tilemap has a system that automatically detects if a tile should be a corner tile, middle tile, etc. Does that still function when you set the tile from code like this?
@PxlDev
Жыл бұрын
Yes, atleast on the version I have used.
@vizualwanderer
3 жыл бұрын
Question: hey do you think it's possible to get all the tiles in a defined/approximate area?
@PxlDev
3 жыл бұрын
I am not currently on my computer (Travelling) But I found this: docs.unity3d.com/ScriptReference/Tilemaps.Tilemap.GetTilesBlock.html It could help.
@vizualwanderer
3 жыл бұрын
@@PxlDev Thx for this. the bound actually might work, i have only used bound once to limit areas where camera can go, maybe its the same logic.
@eggwardosteve
2 жыл бұрын
Hey so important thing here. Make sure you set your grids cell size Z, as 0. Otherwise it will not appear. (Keep in mind i was doing isometric, so I don't know if that is always the case.)
@TechLogicMWO
Жыл бұрын
Thx man, you comment its a pure brilliant and helps me to solve the problem.
@eggwardosteve
2 жыл бұрын
also question, what does mp stand for?
@PxlDev
2 жыл бұрын
In this context mp stands for Mouse Position.
@harrywarman6196
2 жыл бұрын
Hey im geeting an error im not sure about when i run getT() NullReferenceException: Object reference not set to an instance of an object TileInfo.getT (UnityEngine.Vector3 position) (at Assets/TileInfo.cs:29) TileInfo.Update () (at Assets/TileInfo.cs:21)
@harrywarman6196
2 жыл бұрын
here is my code : using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Tilemaps; public class TileInfo : MonoBehaviour { public Tilemap tilemap; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { getT(Input.mousePosition); } } void getT(Vector3 position) { Vector3Int location = tilemap.WorldToCell(position); TileBase target = tilemap.GetTile(location); Debug.Log(target.name); } }
@PxlDev
2 жыл бұрын
Hi, this is what I figured out: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Tilemaps; public class TileInfo : MonoBehaviour { public Tilemap tilemap; void Update() { if (Input.GetKeyDown(KeyCode.A)) { // ScreenToWorldPoint is essential for this to work. // If you just use Input.mousePosition, it is in screen coordinates, // You have to convert the mouse position to world coordinates. Vector2 point = Camera.main.ScreenToWorldPoint(Input.mousePosition); getT(point); } } void getT(Vector3 position) { Vector3Int location = tilemap.WorldToCell(position); TileBase target = tilemap.GetTile(location); // If target isnt null, send name, if is, send No tile found. Debug.Log(target != null ? target.name : "No tile found."); } }
@krethickchakravarthy6533
2 жыл бұрын
Hi, CAN YOU EXPLAIN TILE LOGIC WITH A PLAYER CHARACTER? FOR EXAMPLE, WHEN A PLAYER MOVES ON A TILE, THE TILE GETS CHANGED OR REMOVED.
@karmadesigns6988
2 жыл бұрын
Use the position in world space of your player to identify what cell you are on.
@karmadesigns6988
2 жыл бұрын
then use an if statement so that when the player enters the cell the tile is Set to another tile.
@Selin1234sjsms
Жыл бұрын
How to add collider these tiles ?
@PxlDev
Жыл бұрын
You just have to add a tilemap collider component.
@Selin1234sjsms
Жыл бұрын
Thank you
@GargonStudios
Жыл бұрын
I have isometric tilemap and this is not working :(
@PxlDev
Жыл бұрын
Sorry for the late reply, isometric tilemaps are essentially the same as normal tilemaps in every regard, except in shape, from my experience the shape doesn't effect how everything is programmed. This leaves the possibility of some mistakes either in code or in editor.
Пікірлер: 36