This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes
func removetile():
#vloc is the absolute position of the cursor
  var mouse_pos = $crosshair.global_position
  var loc = Vector2(stepify(mouse_pos.x/16, 1), stepify(mouse_pos.y/16, 1))
  var vloc = Vector2(loc.x+8,loc.y)
  if get_cellv(vloc) == -1:
     set_cellv(vloc, 0)

Should I have to use -1 instead of 0 in set_cell(vloc, 0) ? If yes THEN I HAVE ALREADY TRIED IT
. And here 0 represents the tile which is a blank tile but it dosnt works again

Godot version 3.5.1
in Engine by (20 points)

1 Answer

0 votes

Ok I solved it with removing -1 in if get_cellv(vloc) == -1: and changing it to 1

by (20 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.