0 votes
func place():
placing = false
Level.set_grid_position(("pad" if Pad else "plant"),tile_pos.y,tile_pos.x,ObjectIndex,Plant,null)

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?")

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":
elif type=="plant":
    print(objgrid[row][collumn]," ",plantgrid[row][collumn])
elif type=="griditem":

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

Godot version 3.2.3 stable
in Engine by (42 points)

Please prevent others from making the same mistake.
How did you solve your problem?

1 Answer

0 votes
Best answer

Problem was my carelessness. Script inherited from this script had a separate place function, which i didn't change, and thus it didn't execute setgridposition. Sorry about that.

by (42 points)
selected by

Always check inhrited objects if you have "make sub resources unique" enabled :)

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.