mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix player entity teleport using debug_panel
This commit is contained in:
parent
6dc73646f0
commit
ba9417a7e4
1 changed files with 4 additions and 2 deletions
|
|
@ -185,8 +185,10 @@ void Player::postUpdate() {
|
|||
|
||||
void Player::teleport(glm::vec3 position) {
|
||||
this->position = position;
|
||||
if (auto hitbox = getHitbox()) {
|
||||
hitbox->position = position;
|
||||
|
||||
if (auto entity = level->entities->get(eid)) {
|
||||
entity->getRigidbody().hitbox.position = position;
|
||||
entity->getTransform().setPos(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue