generated from Persson-dev/Godot-Xmake
network: send player velocity
This commit is contained in:
@@ -30,8 +30,8 @@ void ServerWorld::SyncPlayersPos() {
|
||||
for (int i = 0; i < m_Players->get_child_count(); i++) {
|
||||
Player* player = Object::cast_to<Player>(m_Players->get_child(i));
|
||||
DEV_ASSERT(player);
|
||||
m_NetworkInterface->BroadcastPacket(
|
||||
protocol::packets::PlayerPositionAndRotation({player->GetId(), player->get_position(), player->GetCameraRotation()}));
|
||||
m_NetworkInterface->BroadcastPacket(protocol::packets::PlayerPositionAndRotation(
|
||||
{player->GetId(), player->get_position(), player->GetCameraRotation(), player->get_velocity()}));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user