func place():
print("place")
$Sprite/AnimationPlayer.current_animation="idle"
placing = false
Level.set_grid_position(("pad" if Pad else "plant"),tile_pos.y,tile_pos.x,ObjectIndex,Plant,null)
GlobalScript.emit_signal("_on_plant_planted",tile_pos.x,tile_pos.y,origin_button)
This i supposed to print place, it is called by
func _input(event: InputEvent) -> void:
if event.is_action_pressed("lmb"):
if placing:
if get_tile_access(tile_pos.y,tile_pos.x):
print("We're calling the function place but yet it's isn't printing 'place'. Why could that be?")
place()
else:
GlobalScript.emit_signal("_failed_plant_placement")
queue_free()
Since it also should calls this, shouldn't this print too?
func set_grid_position(type:String,row:int,collumn:int,value:int,id:String,data: Dictionary):
print("aha!",type," ",value," ",id)
if type=="pad":
spgrid[row][collumn]=value
padgrid[row][collumn]=id
elif type=="plant":
objgrid[row][collumn]=value
plantgrid[row][collumn]=id
print(objgrid[row][collumn]," ",plantgrid[row][collumn])
elif type=="griditem":
objgrid[row][collumn]=value
itemgrid[row][collumn]=id
itemgriddata[row][collumn]=data
None of these, except the input(), print anything. However i do know that the place() function is called because the animation does change to idle and the placing does disable. I, however, am unsure whether setgrid_position() is being called.
*Functions have been slightly adjusted but nothing is printed.
fixed don't answer im extremely dumb