How to disable autotile collision at a specific place ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Geoffroy

I’m using tilemaps to create a top-down RPG, and I have created an autotile to display a river.

The river has a collision configured, so the player cannot cross it.

I want to be able to add a bridge over it, so the player can cross:
enter image description here

However, I haven’t found a way to disable the collision at this specific place, even using GDScript.

I have found a workaround, using an additional layer for my river. First, I remove a river tile:
enter image description here

Then I manually add some tiles which do not have any collision configured:
enter image description here

And it works this way, but it seems a bit hackish…

My question: Is there a standard way of achieving this result? Or should I proceed the same way everywhere?

I can already guess I’ll have the same problem designing houses, as I want the player to really enter the door, i.e. by stepping on it.

images are made from modified kenney.nl sprites, CC0

:bust_in_silhouette: Reply From: Tut_Mir_Leid

Hey,

i know, this is a old question, but for the people what have the same problem, this youtube-tutorial helped me:
https://youtu.be/AD1XG7LCMjU

Recap: Create an area over the bridge to disable the collision_mask of the player for the water/tilemap when the player enters it and re-enable it when the player exits.

const TILEMAP = 1
func _on_body_entered(body):
	body.set_collision_mask_bit(TILEMAP, false)

func _on_body_exited(body):
	body.set_collision_mask_bit(TILEMAP, true)

Dlean Jeans | 2020-08-23 11:44