invalid asignment of property or key 'movable' with value of type 'bool' on a base object of type 'characterbody3d

Godot Version

4.4

Question

why does it say Invalid asignment of property or key ‘movable’ with value of type ‘bool’ on a base object of type 'characterbody3d` when i put:

get_node(“/root/” + get_tree().current_scene.name + “/Player”).movable = true

Because moveable isn’t a property of CharacterBody3Ds.
What exactly are you trying to do?

Maybe you misspelled it in the definition?
var moveable:bool
var movable:bool

I copied it straight from omogonix it’s to make my CharacterBody3D move after the beginning cutscene of my horror game, and I put var movable = false, look

and

Then this code
get_node(“/root/” + get_tree().current_scene.name + “/Player”)
isn’t working out to what you think it is.
Try dumping the path into a string and printing it out to see if it is valid:

var s:String =  “/root/” + get_tree().current_scene.name + “/Player”   
print(s)

It would also be helpful to link the tutorial. There are lots of videos on his youtube page.

In the first screenshot, it doesn’t look like you’re actually setting the value of movable. If you click on the warning icon below your code, you’ll likely see a warning that says Standalone expression (the line may have no effect). I think you want to add = true to the end of line 9.

1 Like

heres the video i’m at 22:20 and it said the same thing after i put = true or var s:String = “/root/” + get_tree().current_scene.name + “/Player”
print(s)

What was printed after you added the print statement?
Can you show what the player scene looks like? Can you also show your updated code?

the print statement looks like this and its making a new problem and when i tried closing the whole script i couldn’t move anymore so i just remade it and i dont think the script is finished

and i tried yours

oh wait sorry i was supposed to add = true anyways but its still not working

From that screenshot, it looks like the script was removed from the player by accident. Open the player scene, select the root node, and re-attach the player script to it.