playMaker

Author Topic: Unity Tilemap Actions  (Read 1127 times)

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 115
    • View Profile
Unity Tilemap Actions
« on: March 09, 2018, 03:18:59 AM »
I share some of my Unity tilemap actions I made and use for my project.

- Tilemap.SetTile (updated 2018-03-10)
- Tilemap.GetTile (added 2018-03-10)
- GridLayout.CellToWorld (updated 2018-03-10)
- GridLayout.WorldToCell (updated 2018-03-10)

Thanks to djaydino for helping out!
I'll add more as I go. Any tweaking and suggestions are welcome.
« Last Edit: March 09, 2018, 05:08:06 PM by DanielThomas »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4183
    • View Profile
    • jinxtergames
Re: Unity Tilemap Actions
« Reply #1 on: March 12, 2018, 12:51:24 AM »
Hi.
Thx for these, i will check them out.

Can i place them on the Ecosystem?

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 115
    • View Profile
Re: Unity Tilemap Actions
« Reply #2 on: March 12, 2018, 07:04:55 AM »
@djaydino Of course! Let me know if you find something strange in them.

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 185
    • View Profile
    • Haven Made
Re: Unity Tilemap Actions
« Reply #3 on: May 02, 2019, 03:14:29 PM »
Oh gosh! These are wonderful! :D

Do you happen to know if setting to none would make it empty? And then (theoretically) update a grid collider?

Can someone do a quick run down of how these actions work together?

Then get these suckers on Ecosystem haha :D

Thanks!

-craigz
« Last Edit: May 02, 2019, 03:20:46 PM by craigz »

DanielThomas

  • Beta Group
  • Full Member
  • *
  • Posts: 115
    • View Profile
Re: Unity Tilemap Actions
« Reply #4 on: May 02, 2019, 04:30:32 PM »
Not sure, it should work like Tilemap.SetTile does, but it sounds like it would work setting it to null.

Use the 'world to cell' if you have a world position and want to get the cell/tile position. I used it when I wanted to get a tile where the player stod on.

'Cell to world' is obviously the opposite, could be used if you had a teleporter tile position and wanted to world coordinates to set player position.

Set and get tile does what you would expect.

craigz

  • Beta Group
  • Full Member
  • *
  • Posts: 185
    • View Profile
    • Haven Made
Re: Unity Tilemap Actions
« Reply #5 on: May 03, 2019, 03:04:47 AM »
Excellent, thank you :) I was able to get it working pretty well.

I did modify a couple of the actions so a user can target a game object variable and automatically get the tilemap component.

Only usecase I can't quite figure out, is how to make a cell disappear when it's collided with or when a trigger object hits it. Since the point of collision is always outside of that actual cells range  :o