Question by
LordOfKspModding · Jun 17, 2019 at 03:56 PM ·
tilemapscriptableobjecttilesscriptable object
How do I create tiles that I can add scripts to, and have players interact with?
I want to make a scriptable tile called checkpoint that sends a message when a player walks by. Every single scriptable tilemap example makes things like roads and what not. All I want is a tile that I can assign a script and a custom collidor to. This is what I wrote so far. Oh, and by the way, the mouse down void doesnt work. Also, how do I set the collidor type to Trigger, it seems as if the only options are none or some other things.
[CreateAssetMenu]
public class WORKALREADY : TileBase
{
public Sprite main;
public override void GetTileData(Vector3Int location, ITilemap tilemap, ref TileData tileData)
{
tileData.sprite = main;
}
private void OnMouseDown() {
Debug.Log("OH MY GOD WORK");
}
}
Comment