mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-07 02:12:07 +03:00
Sync renamed method in C++ code snippet
This commit is contained in:
@@ -134,7 +134,7 @@ and randomly choose one of the three animation types:
|
||||
godot::Ref<godot::RandomNumberGenerator> random = godot::RandomNumberGenerator::_new();
|
||||
random->randomize();
|
||||
_animated_sprite = get_node<godot::AnimatedSprite2D>("AnimatedSprite2D");
|
||||
_animated_sprite->_set_playing(true);
|
||||
_animated_sprite->set_playing(true);
|
||||
godot::PoolStringArray mob_types = _animated_sprite->get_sprite_frames()->get_animation_names();
|
||||
_animated_sprite->set_animation(mob_types[random->randi() % mob_types.size()]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user