Skip to content

Commit 9b1f171

Browse files
committed
Category factory: Expose CharacterBody2D velocity
And add a "Move and slide" statement block so it can be used.
1 parent 3daad38 commit 9b1f171

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

addons/block_code/ui/picker/categories/category_factory.gd

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,17 @@ static func get_built_in_blocks(_class_name: String) -> Array[Block]:
635635
b.category = "Input"
636636
block_list.append(b)
637637

638+
b = BLOCKS["statement_block"].instantiate()
639+
b.block_type = Types.BlockType.EXECUTE
640+
b.block_format = "Move and slide"
641+
b.statement = "move_and_slide()"
642+
b.category = "Physics | Velocity"
643+
block_list.append(b)
644+
645+
props = {
646+
"velocity": "Physics | Velocity",
647+
}
648+
638649
var prop_list = ClassDB.class_get_property_list(_class_name, true)
639650
block_list.append_array(blocks_from_property_list(prop_list, props))
640651

0 commit comments

Comments
 (0)