feat: tunnels player now initializes player character data
This commit is contained in:
parent
3b8ce8ca53
commit
46ba8efaad
|
@ -1,7 +1,10 @@
|
|||
#include "tunnels_player.hpp"
|
||||
#include "character_data.hpp"
|
||||
#include "godot_cpp/variant/plane.hpp"
|
||||
#include "godot_cpp/variant/projection.hpp"
|
||||
#include "godot_cpp/variant/utility_functions.hpp"
|
||||
#include "player_character.hpp"
|
||||
#include "tunnels_game_state.hpp"
|
||||
#include "utils/game_root.hpp"
|
||||
#include "utils/godot_macros.h"
|
||||
#include "utils/player_input.hpp"
|
||||
|
@ -125,6 +128,9 @@ void TunnelsPlayer::initialize_character() {
|
|||
this->character = Object::cast_to<PlayerCharacter>(player_scene->instantiate());
|
||||
this->get_parent()->add_child(this->character);
|
||||
this->character->set_global_transform(this->get_global_transform());
|
||||
Ref<TunnelsGameState> game_state = GameRoot::get_singleton()->get_game_state();
|
||||
Ref<CharacterData> character = game_state->get_characters()[0];
|
||||
this->character->set_character_data(game_state->get_characters()[0]);
|
||||
// disable navmesh navigation and start using player input
|
||||
this->character->set_manual_mode(true);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue