I'm trying to replicate hit-box system that is utilized in some of fighting games. Take a look here for example for a hit-box viewer tool: http://boxdox-bb.dantarion.com/#/viewer/bbcf_200/jb/NmlAtkAIR5C/20 . As you can see during the course of the animation hit-boxes are added or removed dynamically. Currently I'm using tool script that I call from a
Call Method Track in the
AnimationPlayer this script adds a
CollisionShape2d during the animation, and while this approach is working perfectly fine when i build game, this approach is not working when I'm trying to use it in an editor. Is it possible to somehow call the script in
AnimationPlayer while in editor? And if not what would you suggest as an alternative? Maybe there is an open source project to learn from on how to create this type of dynamic collision system tool in Godot?
Call method track:
Here is the code sample:
func add_rectangle_shape(x, y, width, height):
print_debug(x, y, width, height)
var collision = CollisionShape2D.new()
var shape = RectangleShape2D.new()
shape.extents = Vector2(width, height)
collision.shape = shape
Here is minimum example project:
Any suggestions are appreciated. Thank you very much for spending your precious time!