Selaa lähdekoodia

Merge pull request #64 from aws-lumberyard-dev/LYN6527_MoveMPSampleComponents_into_MultiplayerGem

Move Multiplayer Sample Components into Multiplayer Gem
kberg-amzn 4 vuotta sitten
vanhempi
commit
3aeffcfd2f

+ 0 - 17
Gem/Code/Source/AutoGen/CharacterComponent.AutoComponent.xml

@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<Component
-    Name="CharacterComponent"
-    Namespace="MultiplayerSample"
-    OverrideComponent="true"
-    OverrideController="true"
-    OverrideInclude="Source/Components/CharacterComponent.h"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-    <ComponentRelation Constraint="Required" HasController="true" Name="NetworkTransformComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkTransformComponent.h" />
-
-    <ArchetypeProperty Type="float" Name="WalkSpeed"    Init="3.0f" ExposeToEditor="true" Description="Walk speed, units in meters per second" />
-    <ArchetypeProperty Type="float" Name="SprintSpeed"  Init="5.0f" ExposeToEditor="true" Description="Sprint speed, units in meters per second" />
-    <ArchetypeProperty Type="float" Name="ReverseSpeed" Init="2.0f" ExposeToEditor="true" Description="Reverse speed, units in meters per second" />
-    <ArchetypeProperty Type="float" Name="CrouchSpeed"  Init="1.5f" ExposeToEditor="true" Description="Crouching speed, units in meters per second" />
-</Component>

+ 0 - 1
Gem/Code/Source/AutoGen/NetworkAnimationComponent.AutoComponent.xml

@@ -11,7 +11,6 @@
     <Include File="Source/MultiplayerSampleTypes.h"/>
     <Include File="Source/MultiplayerSampleTypes.h"/>
 
 
     <ComponentRelation Constraint="Required" HasController="true" Name="NetworkTransformComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkTransformComponent.h" />
     <ComponentRelation Constraint="Required" HasController="true" Name="NetworkTransformComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkTransformComponent.h" />
-    <ComponentRelation Constraint="Required" HasController="true" Name="NetworkCharacterComponent" Namespace="MultiplayerSample" Include="Source/Components/NetworkCharacterComponent.h" />
     <ComponentRelation Constraint="Required" HasController="true" Name="SimplePlayerCameraComponent" Namespace="MultiplayerSample" Include="Source/Components/SimplePlayerCameraComponent.h" />
     <ComponentRelation Constraint="Required" HasController="true" Name="SimplePlayerCameraComponent" Namespace="MultiplayerSample" Include="Source/Components/SimplePlayerCameraComponent.h" />
     <ComponentRelation Constraint="Weak" HasController="true" Name="WasdPlayerMovementComponent" Namespace="MultiplayerSample" Include="Source/Components/WasdPlayerMovementComponent.h" />
     <ComponentRelation Constraint="Weak" HasController="true" Name="WasdPlayerMovementComponent" Namespace="MultiplayerSample" Include="Source/Components/WasdPlayerMovementComponent.h" />
 
 

+ 0 - 17
Gem/Code/Source/AutoGen/NetworkCharacterComponent.AutoComponent.xml

@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-
-<Component
-    Name="NetworkCharacterComponent"
-    Namespace="MultiplayerSample"
-    OverrideComponent="true"
-    OverrideController="true"
-    OverrideInclude="Source/Components/NetworkCharacterComponent.h"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-    <ComponentRelation Constraint="Required" HasController="true" Name="NetworkTransformComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkTransformComponent.h" />
-
-    <ArchetypeProperty Type="float" Name="WalkSpeed"    Init="3.0f" ExposeToEditor="true" Description="Walk speed, units in meters per second" />
-    <ArchetypeProperty Type="float" Name="SprintSpeed"  Init="5.0f" ExposeToEditor="true" Description="Sprint speed, units in meters per second" />
-    <ArchetypeProperty Type="float" Name="ReverseSpeed" Init="2.0f" ExposeToEditor="true" Description="Reverse speed, units in meters per second" />
-    <ArchetypeProperty Type="float" Name="CrouchSpeed"  Init="1.5f" ExposeToEditor="true" Description="Crouching speed, units in meters per second" />
-</Component>

+ 0 - 12
Gem/Code/Source/AutoGen/NetworkHitVolumesComponent.AutoComponent.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-
-<Component
-    Name="NetworkHitVolumesComponent"
-    Namespace="MultiplayerSample"
-    OverrideComponent="true"
-    OverrideController="false"
-    OverrideInclude="Source/Components/NetworkHitVolumesComponent.h"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-    <ComponentRelation Constraint="Weak" HasController="false" Name="TransformComponent" Namespace="AzFramework" Include="AzFramework/Components/TransformComponent.h" />
-</Component>

+ 0 - 18
Gem/Code/Source/AutoGen/NetworkRigidBodyComponent.AutoComponent.xml

@@ -1,18 +0,0 @@
-<?xml version="1.0"?>
-
-<Component
-    Name="NetworkRigidBodyComponent"
-    Namespace="MultiplayerSample"
-    OverrideComponent="true"
-    OverrideController="true"
-    OverrideInclude="Source/Components/NetworkRigidBodyComponent.h"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-
-    <ComponentRelation Constraint="Required" HasController="true" Name="NetworkTransformComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkTransformComponent.h" />
-
-    <RemoteProcedure Name="SendApplyImpulse" InvokeFrom="Server" HandleOn="Authority" IsPublic="true" IsReliable="true" GenerateEventBindings="false" Description="Applies an impulse">
-        <Param Type="AZ::Vector3" Name="impulse" />
-        <Param Type="AZ::Vector3" Name="worldPoint" />
-    </RemoteProcedure>
-
-</Component>

+ 7 - 1
Gem/Code/Source/AutoGen/WasdPlayerMovementComponent.AutoComponent.xml

@@ -10,7 +10,7 @@
     
     
     <ComponentRelation Constraint="Required" HasController="true" Name="NetworkTransformComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkTransformComponent.h" />
     <ComponentRelation Constraint="Required" HasController="true" Name="NetworkTransformComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkTransformComponent.h" />
     <ComponentRelation Constraint="Required" HasController="true" Name="NetworkAnimationComponent" Namespace="MultiplayerSample" Include="Source/Components/NetworkAnimationComponent.h" />
     <ComponentRelation Constraint="Required" HasController="true" Name="NetworkAnimationComponent" Namespace="MultiplayerSample" Include="Source/Components/NetworkAnimationComponent.h" />
-    <ComponentRelation Constraint="Required" HasController="true" Name="NetworkCharacterComponent" Namespace="MultiplayerSample" Include="Source/Components/NetworkCharacterComponent.h" />
+    <ComponentRelation Constraint="Required" HasController="true" Name="NetworkCharacterComponent" Namespace="Multiplayer" Include="Multiplayer/Components/NetworkCharacterComponent.h" />
     <ComponentRelation Constraint="Required" HasController="true" Name="SimplePlayerCameraComponent" Namespace="MultiplayerSample" Include="Source/Components/SimplePlayerCameraComponent.h" />
     <ComponentRelation Constraint="Required" HasController="true" Name="SimplePlayerCameraComponent" Namespace="MultiplayerSample" Include="Source/Components/SimplePlayerCameraComponent.h" />
 
 
     <Include File="Source/MultiplayerSampleTypes.h"/>
     <Include File="Source/MultiplayerSampleTypes.h"/>
@@ -25,4 +25,10 @@
     <NetworkInput Type="bool"      Name="Jump"        Init="false" />
     <NetworkInput Type="bool"      Name="Jump"        Init="false" />
     <NetworkInput Type="bool"      Name="Crouch"      Init="false" />
     <NetworkInput Type="bool"      Name="Crouch"      Init="false" />
     <NetworkInput Type="uint8_t"   Name="ResetCount"  Init="0" />
     <NetworkInput Type="uint8_t"   Name="ResetCount"  Init="0" />
+
+    <ArchetypeProperty Type="float" Name="WalkSpeed"    Init="3.0f" ExposeToEditor="true" Description="Walk speed, units in meters per second" />
+    <ArchetypeProperty Type="float" Name="SprintSpeed"  Init="5.0f" ExposeToEditor="true" Description="Sprint speed, units in meters per second" />
+    <ArchetypeProperty Type="float" Name="ReverseSpeed" Init="2.0f" ExposeToEditor="true" Description="Reverse speed, units in meters per second" />
+    <ArchetypeProperty Type="float" Name="CrouchSpeed"  Init="1.5f" ExposeToEditor="true" Description="Crouching speed, units in meters per second" />
+
 </Component>
 </Component>

+ 2 - 2
Gem/Code/Source/Components/NetworkAnimationComponent.cpp

@@ -6,7 +6,7 @@
  */
  */
 
 
 #include <Source/Components/NetworkAnimationComponent.h>
 #include <Source/Components/NetworkAnimationComponent.h>
-#include <Source/Components/NetworkCharacterComponent.h>
+#include <Multiplayer/Components/NetworkCharacterComponent.h>
 #include <Source/Components/SimplePlayerCameraComponent.h>
 #include <Source/Components/SimplePlayerCameraComponent.h>
 #include <Source/Components/WasdPlayerMovementComponent.h>
 #include <Source/Components/WasdPlayerMovementComponent.h>
 #include <Integration/AnimGraphComponentBus.h>
 #include <Integration/AnimGraphComponentBus.h>
@@ -116,7 +116,7 @@ namespace MultiplayerSample
         {
         {
             const AZ::Vector3 velocity = GetWasdPlayerMovementComponent()->GetVelocity();
             const AZ::Vector3 velocity = GetWasdPlayerMovementComponent()->GetVelocity();
             const AZ::Vector2 velocity2d = AZ::Vector2(velocity.GetX(), velocity.GetY());
             const AZ::Vector2 velocity2d = AZ::Vector2(velocity.GetX(), velocity.GetY());
-            const float maxSpeed = GetNetworkCharacterComponent()->GetSprintSpeed();
+            const float maxSpeed = GetWasdPlayerMovementComponent()->GetSprintSpeed();
             m_animationGraph->SetParameterVector2(m_velocityParamId, velocity2d / maxSpeed);
             m_animationGraph->SetParameterVector2(m_velocityParamId, velocity2d / maxSpeed);
         }
         }
 
 

+ 0 - 213
Gem/Code/Source/Components/NetworkCharacterComponent.cpp

@@ -1,213 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project
- * 
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <Source/Components/NetworkCharacterComponent.h>
-#include <Source/Components/NetworkRigidBodyComponent.h>
-#include <AzFramework/Visibility/EntityBoundsUnionBus.h>
-#include <AzFramework/Physics/CharacterBus.h>
-#include <AzFramework/Physics/Character.h>
-#include <Multiplayer/Components/NetworkTransformComponent.h>
-#include <Multiplayer/NetworkTime/INetworkTime.h>
-#include <PhysXCharacters/API/CharacterController.h>
-#include <PhysX/PhysXLocks.h>
-#include <PhysX/Utils.h>
-
-namespace MultiplayerSample
-{
-    bool CollisionLayerBasedControllerFilter(const physx::PxController& controllerA, const physx::PxController& controllerB)
-    {
-        PHYSX_SCENE_READ_LOCK(controllerA.getActor()->getScene());
-        physx::PxRigidDynamic* actorA = controllerA.getActor();
-        physx::PxRigidDynamic* actorB = controllerB.getActor();
-
-        if (actorA && actorA->getNbShapes() > 0 && actorB && actorB->getNbShapes() > 0)
-        {
-            physx::PxShape* shapeA = nullptr;
-            actorA->getShapes(&shapeA, 1, 0);
-            physx::PxFilterData filterDataA = shapeA->getSimulationFilterData();
-            physx::PxShape* shapeB = nullptr;
-            actorB->getShapes(&shapeB, 1, 0);
-            physx::PxFilterData filterDataB = shapeB->getSimulationFilterData();
-            return PhysX::Utils::Collision::ShouldCollide(filterDataA, filterDataB);
-        }
-
-        return true;
-    }
-
-    physx::PxQueryHitType::Enum CollisionLayerBasedObjectPreFilter(
-        const physx::PxFilterData& filterData,
-        const physx::PxShape* shape,
-        const physx::PxRigidActor* actor,
-        [[maybe_unused]] physx::PxHitFlags& queryFlags)
-    {
-        // non-kinematic dynamic bodies should not impede the movement of the character
-        if (actor->getConcreteType() == physx::PxConcreteType::eRIGID_DYNAMIC)
-        {
-            const physx::PxRigidDynamic* rigidDynamic = static_cast<const physx::PxRigidDynamic*>(actor);
-
-            bool isKinematic = (rigidDynamic->getRigidBodyFlags() & physx::PxRigidBodyFlag::eKINEMATIC);
-            if (isKinematic)
-            {
-                const PhysX::ActorData* actorData = PhysX::Utils::GetUserData(rigidDynamic);
-                if (actorData)
-                {
-                    const AZ::EntityId entityId = actorData->GetEntityId();
-
-                    if (NetworkRigidBodyRequestBus::FindFirstHandler(entityId) != nullptr)
-                    {
-                        // Network rigid bodies are kinematic on the client but dynamic on the server,
-                        // hence filtering treats these actors as dynamic to support client prediction and avoid desyncs
-                        isKinematic = false;
-                    }
-                }
-            }
-
-            if (!isKinematic)
-            {
-                return physx::PxQueryHitType::eNONE;
-            }
-        }
-
-        // all other cases should be determined by collision filters
-        if (PhysX::Utils::Collision::ShouldCollide(filterData, shape->getSimulationFilterData()))
-        {
-            return physx::PxQueryHitType::eBLOCK;
-        }
-
-        return physx::PxQueryHitType::eNONE;
-    }
-
-    void NetworkCharacterComponent::NetworkCharacterComponent::Reflect(AZ::ReflectContext* context)
-    {
-        AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
-        if (serializeContext)
-        {
-            serializeContext->Class<NetworkCharacterComponent, NetworkCharacterComponentBase>()
-                ->Version(1);
-        }
-        NetworkCharacterComponentBase::Reflect(context);
-    }
-
-    NetworkCharacterComponent::NetworkCharacterComponent()
-        : m_translationEventHandler([this](const AZ::Vector3& translation) { OnTranslationChangedEvent(translation); })
-    {
-        ;
-    }
-
-    void NetworkCharacterComponent::OnInit()
-    {
-        ;
-    }
-
-    void NetworkCharacterComponent::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        Physics::CharacterRequests* characterRequests = Physics::CharacterRequestBus::FindFirstHandler(GetEntityId());
-        m_physicsCharacter = (characterRequests != nullptr) ? characterRequests->GetCharacter() : nullptr;
-        GetNetBindComponent()->AddEntitySyncRewindEventHandler(m_syncRewindHandler);
-
-        if (m_physicsCharacter)
-        {
-            auto controller = static_cast<PhysX::CharacterController*>(m_physicsCharacter);
-            controller->SetFilterFlags(physx::PxQueryFlag::eSTATIC | physx::PxQueryFlag::eDYNAMIC | physx::PxQueryFlag::ePREFILTER);
-            if (auto callbackManager = controller->GetCallbackManager())
-            {
-                callbackManager->SetControllerFilter(CollisionLayerBasedControllerFilter);
-                callbackManager->SetObjectPreFilter(CollisionLayerBasedObjectPreFilter);
-            }
-        }
-
-        if (!HasController())
-        {
-            GetNetworkTransformComponent()->TranslationAddEvent(m_translationEventHandler);
-        }
-    }
-
-    void NetworkCharacterComponent::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        ;
-    }
-
-    void NetworkCharacterComponent::OnTranslationChangedEvent([[maybe_unused]] const AZ::Vector3& translation)
-    {
-        OnSyncRewind();
-    }
-
-    void NetworkCharacterComponent::OnSyncRewind()
-    {
-        if (m_physicsCharacter == nullptr)
-        {
-            return;
-        }
-
-        const AZ::Vector3 currPosition = m_physicsCharacter->GetBasePosition();
-        if (!currPosition.IsClose(GetNetworkTransformComponent()->GetTranslation()))
-        {
-            uint32_t frameId = static_cast<uint32_t>(Multiplayer::GetNetworkTime()->GetHostFrameId());
-            m_physicsCharacter->SetFrameId(frameId);
-            //m_physicsCharacter->SetBasePosition(GetNetworkTransformComponent()->GetTranslation());
-        }
-    }
-
-    bool NetworkCharacterComponent::IsOnGround() const
-    {
-        auto pxController = static_cast<physx::PxController*>(m_physicsCharacter->GetNativePointer());
-        if (!pxController)
-        {
-            return true;
-        }
-
-        physx::PxControllerState state;
-        pxController->getState(state);
-        return state.touchedActor != nullptr || (state.collisionFlags & physx::PxControllerCollisionFlag::eCOLLISION_DOWN) != 0;
-    }
-
-    NetworkCharacterComponentController::NetworkCharacterComponentController(NetworkCharacterComponent& parent)
-        : NetworkCharacterComponentControllerBase(parent)
-    {
-        ;
-    }
-
-    void NetworkCharacterComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        ;
-    }
-
-    void NetworkCharacterComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        ;
-    }
-
-    AZ::Vector3 NetworkCharacterComponentController::TryMoveWithVelocity(const AZ::Vector3& velocity, float deltaTime)
-    {
-        // Ensure any entities that we might interact with are properly synchronized to their rewind state
-        if (IsAuthority())
-        {
-            const AZ::Aabb entityStartBounds = AZ::Interface<AzFramework::IEntityBoundsUnion>::Get()->GetEntityLocalBoundsUnion(GetEntity()->GetId());
-            const AZ::Aabb entityFinalBounds = entityStartBounds.GetTranslated(velocity);
-            AZ::Aabb entitySweptBounds = entityStartBounds;
-            entitySweptBounds.AddAabb(entityFinalBounds);
-            Multiplayer::GetNetworkTime()->SyncEntitiesToRewindState(entitySweptBounds);
-        }
-
-        if ((GetParent().m_physicsCharacter == nullptr) || (velocity.GetLengthSq() <= 0.0f))
-        {
-            return GetEntity()->GetTransform()->GetWorldTranslation();
-        }
-        GetParent().m_physicsCharacter->AddVelocity(velocity);
-        GetParent().m_physicsCharacter->ApplyRequestedVelocity(deltaTime);
-        GetEntity()->GetTransform()->SetWorldTranslation(GetParent().m_physicsCharacter->GetBasePosition());
-        AZLOG
-        (
-            NET_Movement,
-            "Moved to position %f x %f x %f",
-            GetParent().m_physicsCharacter->GetBasePosition().GetX(),
-            GetParent().m_physicsCharacter->GetBasePosition().GetY(),
-            GetParent().m_physicsCharacter->GetBasePosition().GetZ()
-        );
-        return GetEntity()->GetTransform()->GetWorldTranslation();
-    }
-}

+ 0 - 70
Gem/Code/Source/Components/NetworkCharacterComponent.h

@@ -1,70 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project
- * 
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include <Source/AutoGen/NetworkCharacterComponent.AutoComponent.h>
-#include <Multiplayer/Components/NetBindComponent.h>
-#include <PhysX/CharacterGameplayBus.h>
-
-namespace Physics
-{
-    class Character;
-}
-
-namespace MultiplayerSample
-{
-    class NetworkCharacterComponent
-        : public NetworkCharacterComponentBase
-        , private PhysX::CharacterGameplayRequestBus::Handler
-    {
-        friend class NetworkCharacterComponentController;
-
-    public:
-        AZ_MULTIPLAYER_COMPONENT(MultiplayerSample::NetworkCharacterComponent, s_networkCharacterComponentConcreteUuid, MultiplayerSample::NetworkCharacterComponentBase);
-
-        static void Reflect(AZ::ReflectContext* context);
-
-        NetworkCharacterComponent();
-
-        static void GetIncompatibleServices(AZ::ComponentDescriptor::DependencyArrayType& incompatible)
-        {
-            incompatible.push_back(AZ_CRC_CE("NetworkRigidBodyService"));
-        }
-
-        void OnInit() override;
-        void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-        void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-
-    private:
-        void OnTranslationChangedEvent(const AZ::Vector3& translation);
-        void OnSyncRewind();
-
-        // CharacterGameplayRequestBus
-        bool IsOnGround() const override;
-        float GetGravityMultiplier() const override { return {}; }
-        void SetGravityMultiplier([[maybe_unused]] float gravityMultiplier) override {}
-        AZ::Vector3 GetFallingVelocity() const override { return {}; }
-        void SetFallingVelocity([[maybe_unused]] const AZ::Vector3& fallingVelocity) override {}
-
-        Physics::Character* m_physicsCharacter = nullptr;
-        Multiplayer::EntitySyncRewindEvent::Handler m_syncRewindHandler = Multiplayer::EntitySyncRewindEvent::Handler([this]() { OnSyncRewind(); });
-        AZ::Event<AZ::Vector3>::Handler m_translationEventHandler;
-    };
-
-    class NetworkCharacterComponentController
-        : public NetworkCharacterComponentControllerBase
-    {
-    public:
-        NetworkCharacterComponentController(NetworkCharacterComponent& parent);
-
-        void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-        void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-
-        AZ::Vector3 TryMoveWithVelocity(const AZ::Vector3& velocity, float deltaTime);
-    };
-}

+ 0 - 222
Gem/Code/Source/Components/NetworkHitVolumesComponent.cpp

@@ -1,222 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project
- * 
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <Source/Components/NetworkHitVolumesComponent.h>
-#include <AzFramework/Components/TransformComponent.h>
-#include <AzFramework/Physics/Common/PhysicsTypes.h>
-#include <AzFramework/Physics/CharacterBus.h>
-#include <AzFramework/Physics/Character.h>
-#include <AzFramework/Physics/SystemBus.h>
-#include <AzFramework/Physics/Material.h>
-#include <MCore/Source/AzCoreConversions.h>
-#include <Integration/ActorComponentBus.h>
-#include <Integration/AnimGraphNetworkingBus.h>
-
-namespace MultiplayerSample
-{
-    AZ_CVAR(bool, bg_DrawArticulatedHitVolumes, false, nullptr, AZ::ConsoleFunctorFlags::Null, "Enables debug draw of articulated hit volumes");
-    AZ_CVAR(float, bg_DrawDebugHitVolumeLifetime, 0.0f, nullptr, AZ::ConsoleFunctorFlags::Null, "The lifetime for hit volume draw-debug shapes");
-
-    AZ_CVAR(float, bg_RewindPositionTolerance, 0.0001f, nullptr, AZ::ConsoleFunctorFlags::Null, "Don't sync the physx entity if the square of delta position is less than this value");
-    AZ_CVAR(float, bg_RewindOrientationTolerance, 0.001f, nullptr, AZ::ConsoleFunctorFlags::Null, "Don't sync the physx entity if the square of delta orientation is less than this value");
-
-    NetworkHitVolumesComponent::AnimatedHitVolume::AnimatedHitVolume
-    (
-        AzNetworking::ConnectionId connectionId,
-        Physics::CharacterRequests* character,
-        const char* hitVolumeName,
-        const Physics::ColliderConfiguration* colliderConfig,
-        const Physics::ShapeConfiguration* shapeConfig,
-        const uint32_t jointIndex
-    )
-        : m_colliderConfig(colliderConfig)
-        , m_shapeConfig(shapeConfig)
-        , m_jointIndex(jointIndex)
-    {
-        m_transform.SetOwningConnectionId(connectionId);
-
-        m_colliderOffSetTransform = AZ::Transform::CreateFromQuaternionAndTranslation(m_colliderConfig->m_rotation, m_colliderConfig->m_position);
-
-        if (m_colliderConfig->m_isExclusive)
-        {
-            Physics::SystemRequestBus::BroadcastResult(m_physicsShape, &Physics::SystemRequests::CreateShape, *m_colliderConfig, *m_shapeConfig);
-        }
-        else
-        {
-            Physics::ColliderConfiguration colliderConfiguration = *m_colliderConfig;
-            colliderConfiguration.m_isExclusive = true;
-            colliderConfiguration.m_isSimulated = false;
-            colliderConfiguration.m_isInSceneQueries = true;
-            Physics::SystemRequestBus::BroadcastResult(m_physicsShape, &Physics::SystemRequests::CreateShape, colliderConfiguration, *m_shapeConfig);
-        }
-
-        if (m_physicsShape)
-        {
-            m_physicsShape->SetName(hitVolumeName);
-            character->GetCharacter()->AttachShape(m_physicsShape);
-        }
-    }
-
-    void NetworkHitVolumesComponent::AnimatedHitVolume::UpdateTransform(const AZ::Transform& transform)
-    {
-        m_transform = transform;
-        m_physicsShape->SetLocalPose(transform.GetTranslation(), transform.GetRotation());
-    }
-
-    void NetworkHitVolumesComponent::AnimatedHitVolume::SyncToCurrentTransform()
-    {
-        AZ::Transform rewoundTransform;
-        const AZ::Transform& targetTransform = m_transform.Get();
-        const float blendFactor = Multiplayer::GetNetworkTime()->GetHostBlendFactor();
-        if (blendFactor < 1.f)
-        {
-            // If a blend factor was supplied, interpolate the transform appropriately
-            const AZ::Transform& previousTransform = m_transform.GetPrevious();
-            rewoundTransform.SetRotation(previousTransform.GetRotation().Slerp(targetTransform.GetRotation(), blendFactor));
-            rewoundTransform.SetTranslation(previousTransform.GetTranslation().Lerp(targetTransform.GetTranslation(), blendFactor));
-            rewoundTransform.SetUniformScale(AZ::Lerp(previousTransform.GetUniformScale(), targetTransform.GetUniformScale(), blendFactor));
-        }
-        else
-        {
-            rewoundTransform = m_transform.Get();
-        }
-
-        const AZ::Transform  physicsTransform = AZ::Transform::CreateFromQuaternionAndTranslation(m_physicsShape->GetLocalPose().second, m_physicsShape->GetLocalPose().first);
-
-        // Don't call SetLocalPose unless the transforms are actually different
-        const AZ::Vector3 positionDelta = physicsTransform.GetTranslation() - rewoundTransform.GetTranslation();
-        const AZ::Quaternion orientationDelta = physicsTransform.GetRotation() - rewoundTransform.GetRotation();
-
-        if ((positionDelta.GetLengthSq() >= bg_RewindPositionTolerance) || (orientationDelta.GetLengthSq() >= bg_RewindOrientationTolerance))
-        {
-            m_physicsShape->SetLocalPose(rewoundTransform.GetTranslation(), rewoundTransform.GetRotation());
-        }
-    }
-
-    void NetworkHitVolumesComponent::NetworkHitVolumesComponent::Reflect(AZ::ReflectContext* context)
-    {
-        AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
-        if (serializeContext)
-        {
-            serializeContext->Class<NetworkHitVolumesComponent, NetworkHitVolumesComponentBase>()
-                ->Version(1);
-        }
-        NetworkHitVolumesComponentBase::Reflect(context);
-    }
-
-    NetworkHitVolumesComponent::NetworkHitVolumesComponent()
-        : m_syncRewindHandler([this]() { OnSyncRewind(); })
-        , m_preRenderHandler([this](float deltaTime, float blendFactor) { OnPreRender(deltaTime, blendFactor); })
-        , m_transformChangedHandler([this](const AZ::Transform&, const AZ::Transform& worldTm) { OnTransformUpdate(worldTm); })
-    {
-        ;
-    }
-
-    void NetworkHitVolumesComponent::OnInit()
-    {
-        ;
-    }
-
-    void NetworkHitVolumesComponent::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        EMotionFX::Integration::ActorComponentNotificationBus::Handler::BusConnect(GetEntityId());
-        GetNetBindComponent()->AddEntitySyncRewindEventHandler(m_syncRewindHandler);
-        m_physicsCharacter = Physics::CharacterRequestBus::FindFirstHandler(GetEntityId());
-        GetTransformComponent()->BindTransformChangedEventHandler(m_transformChangedHandler);
-        OnTransformUpdate(GetTransformComponent()->GetWorldTM());
-    }
-
-    void NetworkHitVolumesComponent::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        DestroyHitVolumes();
-        EMotionFX::Integration::ActorComponentNotificationBus::Handler::BusDisconnect();
-    }
-
-    void NetworkHitVolumesComponent::OnPreRender([[maybe_unused]] float deltaTime, [[maybe_unused]] float blendFactor)
-    {
-        if (m_animatedHitVolumes.size() <= 0)
-        {
-            CreateHitVolumes();
-        }
-
-        AZ::Vector3 position, scale;
-        AZ::Quaternion rotation;
-        for (AnimatedHitVolume& hitVolume : m_animatedHitVolumes)
-        {
-            m_actorComponent->GetJointTransformComponents(hitVolume.m_jointIndex, EMotionFX::Integration::Space::ModelSpace, position, rotation, scale);
-            hitVolume.UpdateTransform(AZ::Transform::CreateFromQuaternionAndTranslation(rotation, position) * hitVolume.m_colliderOffSetTransform);
-        }
-    }
-
-    void NetworkHitVolumesComponent::OnTransformUpdate([[maybe_unused]] const AZ::Transform& transform)
-    {
-        OnSyncRewind();
-    }
-
-    void NetworkHitVolumesComponent::OnSyncRewind()
-    {
-        if (m_physicsCharacter && m_physicsCharacter->GetCharacter())
-        {
-            uint32_t frameId = static_cast<uint32_t>(Multiplayer::GetNetworkTime()->GetHostFrameId());
-            m_physicsCharacter->GetCharacter()->SetFrameId(frameId);
-        }
-
-        for (AnimatedHitVolume& hitVolume : m_animatedHitVolumes)
-        {
-            hitVolume.SyncToCurrentTransform();
-        }
-    }
-
-    void NetworkHitVolumesComponent::CreateHitVolumes()
-    {
-        if (m_physicsCharacter == nullptr || m_actorComponent == nullptr)
-        {
-            return;
-        }
-
-        const Physics::AnimationConfiguration* physicsConfig = m_actorComponent->GetPhysicsConfig();
-        if (physicsConfig == nullptr)
-        {
-            return;
-        }
-
-        m_hitDetectionConfig = &physicsConfig->m_hitDetectionConfig;
-        const AzNetworking::ConnectionId owningConnectionId = GetNetBindComponent()->GetOwningConnectionId();
-
-        m_animatedHitVolumes.reserve(m_hitDetectionConfig->m_nodes.size());
-        for (const Physics::CharacterColliderNodeConfiguration& nodeConfig : m_hitDetectionConfig->m_nodes)
-        {
-            const AZStd::size_t jointIndex = m_actorComponent->GetJointIndexByName(nodeConfig.m_name.c_str());
-            if (jointIndex == EMotionFX::Integration::ActorComponentRequests::s_invalidJointIndex)
-            {
-                continue;
-            }
-
-            for (const AzPhysics::ShapeColliderPair& coliderPair : nodeConfig.m_shapes)
-            {
-                const Physics::ColliderConfiguration* colliderConfig = coliderPair.first.get();
-                Physics::ShapeConfiguration* shapeConfig = coliderPair.second.get();
-                m_animatedHitVolumes.emplace_back(owningConnectionId, m_physicsCharacter, nodeConfig.m_name.c_str(), colliderConfig, shapeConfig, aznumeric_cast<uint32_t>(jointIndex));
-            }
-        }
-    }
-
-    void NetworkHitVolumesComponent::DestroyHitVolumes()
-    {
-        m_animatedHitVolumes.clear();
-    }
-
-    void NetworkHitVolumesComponent::OnActorInstanceCreated([[maybe_unused]] EMotionFX::ActorInstance* actorInstance)
-    {
-        m_actorComponent = EMotionFX::Integration::ActorComponentRequestBus::FindFirstHandler(GetEntity()->GetId());
-    }
-
-    void NetworkHitVolumesComponent::OnActorInstanceDestroyed([[maybe_unused]] EMotionFX::ActorInstance* actorInstance)
-    {
-        m_actorComponent = nullptr;
-    }
-}

+ 0 - 89
Gem/Code/Source/Components/NetworkHitVolumesComponent.h

@@ -1,89 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project
- * 
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#pragma once
-
-#include <Source/AutoGen/NetworkHitVolumesComponent.AutoComponent.h>
-#include <Multiplayer/Components/NetBindComponent.h>
-#include <Integration/ActorComponentBus.h>
-#include <AzCore/Component/TransformBus.h>
-
-namespace Physics
-{
-    class CharacterRequests;
-    class CharacterHitDetectionConfiguration;
-}
-
-namespace MultiplayerSample
-{
-    class NetworkHitVolumesComponent
-        : public NetworkHitVolumesComponentBase
-        , private EMotionFX::Integration::ActorComponentNotificationBus::Handler
-    {
-    public:
-        struct AnimatedHitVolume final
-        {
-            AnimatedHitVolume
-            (
-                AzNetworking::ConnectionId connectionId,
-                Physics::CharacterRequests* character,
-                const char* hitVolumeName,
-                const Physics::ColliderConfiguration* colliderConfig,
-                const Physics::ShapeConfiguration* shapeConfig,
-                const uint32_t jointIndex
-            );
-
-            ~AnimatedHitVolume() = default;
-
-            void UpdateTransform(const AZ::Transform& transform);
-            void SyncToCurrentTransform();
-
-            Multiplayer::RewindableObject<AZ::Transform, Multiplayer::RewindHistorySize> m_transform;
-            AZStd::shared_ptr<Physics::Shape> m_physicsShape;
-
-            // Cached so we don't have to do subsequent lookups by name
-            const Physics::ColliderConfiguration* m_colliderConfig = nullptr;
-            const Physics::ShapeConfiguration* m_shapeConfig = nullptr;
-            AZ::Transform m_colliderOffSetTransform;
-            const AZ::u32 m_jointIndex = 0;
-        };
-
-        AZ_MULTIPLAYER_COMPONENT(MultiplayerSample::NetworkHitVolumesComponent, s_networkHitVolumesComponentConcreteUuid, MultiplayerSample::NetworkHitVolumesComponentBase);
-
-        static void Reflect(AZ::ReflectContext* context);
-
-        NetworkHitVolumesComponent();
-
-        void OnInit() override;
-        void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-        void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-
-    private:
-        void OnPreRender(float deltaTime, float blendFactor);
-        void OnTransformUpdate(const AZ::Transform& transform);
-        void OnSyncRewind();
-
-        void CreateHitVolumes();
-        void DestroyHitVolumes();
-
-        //! ActorComponentNotificationBus::Handler
-        //! @{
-        void OnActorInstanceCreated(EMotionFX::ActorInstance* actorInstance) override;
-        void OnActorInstanceDestroyed(EMotionFX::ActorInstance* actorInstance) override;
-        //! @}
-
-        Physics::CharacterRequests* m_physicsCharacter = nullptr;
-        EMotionFX::Integration::ActorComponentRequests* m_actorComponent = nullptr;
-        const Physics::CharacterColliderConfiguration* m_hitDetectionConfig = nullptr;
-
-        AZStd::vector<AnimatedHitVolume> m_animatedHitVolumes;
-
-        Multiplayer::EntitySyncRewindEvent::Handler m_syncRewindHandler;
-        Multiplayer::EntityPreRenderEvent::Handler m_preRenderHandler;
-        AZ::TransformChangedEvent::Handler m_transformChangedHandler;
-    };
-}

+ 0 - 147
Gem/Code/Source/Components/NetworkRigidBodyComponent.cpp

@@ -1,147 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
- * 
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-#include <Source/Components/NetworkRigidBodyComponent.h>
-#include <AzFramework/Components/TransformComponent.h>
-#include <AzFramework/Physics/RigidBodyBus.h>
-#include <AzFramework/Physics/SimulatedBodies/RigidBody.h>
-
-namespace MultiplayerSample
-{
-    AZ_CVAR_EXTERNED(float, bg_RewindPositionTolerance);
-    AZ_CVAR_EXTERNED(float, bg_RewindOrientationTolerance);
-
-    void NetworkRigidBodyComponent::NetworkRigidBodyComponent::Reflect(AZ::ReflectContext* context)
-    {
-        AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(context);
-        if (serializeContext)
-        {
-            serializeContext->Class<NetworkRigidBodyComponent, NetworkRigidBodyComponentBase>()->Version(1);
-        }
-        NetworkRigidBodyComponentBase::Reflect(context);
-    }
-
-    void NetworkRigidBodyComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
-    {
-        provided.push_back(AZ_CRC_CE("NetworkRigidBodyService"));
-    }
-
-    void NetworkRigidBodyComponent::GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required)
-    {
-        required.push_back(AZ_CRC_CE("PhysXRigidBodyService"));
-    }
-
-    void NetworkRigidBodyComponent::GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent)
-    {
-        dependent.push_back(AZ_CRC_CE("TransformService"));
-        dependent.push_back(AZ_CRC_CE("PhysXRigidBodyService"));
-    }
-
-    NetworkRigidBodyComponent::NetworkRigidBodyComponent()
-        : m_syncRewindHandler([this](){ OnSyncRewind(); })
-        , m_transformChangedHandler([this]([[maybe_unused]] const AZ::Transform& localTm, const AZ::Transform& worldTm){ OnTransformUpdate(worldTm); })
-    {
-    }
-
-    void NetworkRigidBodyComponent::OnInit()
-    {
-    }
-
-    void NetworkRigidBodyComponent::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        NetworkRigidBodyRequestBus::Handler::BusConnect(GetEntityId());
-
-        GetNetBindComponent()->AddEntitySyncRewindEventHandler(m_syncRewindHandler);
-        GetEntity()->FindComponent<AzFramework::TransformComponent>()->BindTransformChangedEventHandler(m_transformChangedHandler);
-
-        m_physicsRigidBodyComponent =
-            Physics::RigidBodyRequestBus::FindFirstHandler(GetEntity()->GetId());
-        AZ_Assert(m_physicsRigidBodyComponent, "PhysX Rigid Body Component is required on entity %s", GetEntity()->GetName().c_str());
-
-        if (!HasController())
-        {
-            m_physicsRigidBodyComponent->SetKinematic(true);
-        }
-    }
-
-    void NetworkRigidBodyComponent::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        NetworkRigidBodyRequestBus::Handler::BusDisconnect();
-    }
-
-    void NetworkRigidBodyComponent::OnTransformUpdate(const AZ::Transform& worldTm)
-    {
-        m_transform = worldTm;
-
-        if (!HasController())
-        {
-            m_physicsRigidBodyComponent->SetKinematicTarget(worldTm);
-        }
-    }
-
-    void NetworkRigidBodyComponent::OnSyncRewind()
-    {
-        uint32_t frameId = static_cast<uint32_t>(Multiplayer::GetNetworkTime()->GetHostFrameId());
-
-        AzPhysics::RigidBody* rigidBody = m_physicsRigidBodyComponent->GetRigidBody();
-        rigidBody->SetFrameId(frameId);
-
-        AZ::Transform rewoundTransform;
-        const AZ::Transform& targetTransform = m_transform.Get();
-        const float blendFactor = Multiplayer::GetNetworkTime()->GetHostBlendFactor();
-        if (blendFactor < 1.f)
-        {
-            // If a blend factor was supplied, interpolate the transform appropriately
-            const AZ::Transform& previousTransform = m_transform.GetPrevious();
-            rewoundTransform.SetRotation(previousTransform.GetRotation().Slerp(targetTransform.GetRotation(), blendFactor));
-            rewoundTransform.SetTranslation(previousTransform.GetTranslation().Lerp(targetTransform.GetTranslation(), blendFactor));
-            rewoundTransform.SetUniformScale(AZ::Lerp(previousTransform.GetUniformScale(), targetTransform.GetUniformScale(), blendFactor));
-        }
-        else
-        {
-            rewoundTransform = m_transform.Get();
-        }
-        const AZ::Transform& physicsTransform = rigidBody->GetTransform();
-
-        // Don't call SetLocalPose unless the transforms are actually different
-        const AZ::Vector3 positionDelta = physicsTransform.GetTranslation() - rewoundTransform.GetTranslation();
-        const AZ::Quaternion orientationDelta = physicsTransform.GetRotation() - rewoundTransform.GetRotation();
-
-        if ((positionDelta.GetLengthSq() >= bg_RewindPositionTolerance) ||
-            (orientationDelta.GetLengthSq() >= bg_RewindOrientationTolerance))
-        {
-            rigidBody->SetTransform(rewoundTransform);
-        }
-    }
-
-    NetworkRigidBodyComponentController::NetworkRigidBodyComponentController(NetworkRigidBodyComponent& parent)
-        : NetworkRigidBodyComponentControllerBase(parent)
-    {
-        ;
-    }
-
-    void NetworkRigidBodyComponentController::OnActivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        ;
-    }
-
-    void NetworkRigidBodyComponentController::OnDeactivate([[maybe_unused]] Multiplayer::EntityIsMigrating entityIsMigrating)
-    {
-        ;
-    }
-
-    void NetworkRigidBodyComponentController::HandleSendApplyImpulse
-    (
-        [[maybe_unused]] AzNetworking::IConnection* invokingConnection,
-        const AZ::Vector3& impulse,
-        const AZ::Vector3& worldPoint
-    )
-    {
-        AzPhysics::RigidBody* rigidBody = GetParent().m_physicsRigidBodyComponent->GetRigidBody();
-        rigidBody->ApplyLinearImpulseAtWorldPoint(impulse, worldPoint);
-    }
-} // namespace MultiplayerSample

+ 0 - 68
Gem/Code/Source/Components/NetworkRigidBodyComponent.h

@@ -1,68 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
- * 
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-#pragma once
-
-#include <Source/AutoGen/NetworkRigidBodyComponent.AutoComponent.h>
-#include <AzCore/Component/TransformBus.h>
-#include <Multiplayer/Components/NetBindComponent.h>
-
-namespace Physics
-{
-    class RigidBodyRequests;
-}
-
-namespace MultiplayerSample
-{
-    //! Bus for requests to the network rigid body component.
-    class NetworkRigidBodyRequests : public AZ::ComponentBus
-    {
-    };
-    using NetworkRigidBodyRequestBus = AZ::EBus<NetworkRigidBodyRequests>;
-
-    class NetworkRigidBodyComponent final
-        : public NetworkRigidBodyComponentBase
-        , private NetworkRigidBodyRequestBus::Handler
-    {
-        friend class NetworkRigidBodyComponentController;
-
-    public:
-        AZ_MULTIPLAYER_COMPONENT(
-            MultiplayerSample::NetworkRigidBodyComponent, s_networkRigidBodyComponentConcreteUuid, MultiplayerSample::NetworkRigidBodyComponentBase);
-
-        static void Reflect(AZ::ReflectContext* context);
-        static void GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided);
-        static void GetRequiredServices(AZ::ComponentDescriptor::DependencyArrayType& required);
-        static void GetDependentServices(AZ::ComponentDescriptor::DependencyArrayType& dependent);
-
-        NetworkRigidBodyComponent();
-
-        void OnInit() override;
-        void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-        void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-
-    private:
-        void OnTransformUpdate(const AZ::Transform& worldTm);
-        void OnSyncRewind();
-
-        Multiplayer::EntitySyncRewindEvent::Handler m_syncRewindHandler;
-        AZ::TransformChangedEvent::Handler m_transformChangedHandler;
-        Physics::RigidBodyRequests* m_physicsRigidBodyComponent = nullptr;
-        Multiplayer::RewindableObject<AZ::Transform, Multiplayer::RewindHistorySize> m_transform;
-    };
-
-    class NetworkRigidBodyComponentController
-        : public NetworkRigidBodyComponentControllerBase
-    {
-    public:
-        NetworkRigidBodyComponentController(NetworkRigidBodyComponent& parent);
-
-        void OnActivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-        void OnDeactivate(Multiplayer::EntityIsMigrating entityIsMigrating) override;
-
-        void HandleSendApplyImpulse(AzNetworking::IConnection* invokingConnection, const AZ::Vector3& impulse, const AZ::Vector3& worldPoint) override;
-    };
-} // namespace MultiplayerSample

+ 3 - 5
Gem/Code/Source/Components/NetworkWeaponsComponent.cpp

@@ -10,7 +10,7 @@
 #include <Source/Components/NetworkAiComponent.h>
 #include <Source/Components/NetworkAiComponent.h>
 #include <Source/Components/NetworkAnimationComponent.h>
 #include <Source/Components/NetworkAnimationComponent.h>
 #include <Source/Components/NetworkHealthComponent.h>
 #include <Source/Components/NetworkHealthComponent.h>
-#include <Source/Components/NetworkRigidBodyComponent.h>
+#include <Multiplayer/Components/NetworkRigidBodyComponent.h>
 #include <Source/Components/SimplePlayerCameraComponent.h>
 #include <Source/Components/SimplePlayerCameraComponent.h>
 #include <Source/Weapons/BaseWeapon.h>
 #include <Source/Weapons/BaseWeapon.h>
 #include <AzCore/Component/TransformBus.h>
 #include <AzCore/Component/TransformBus.h>
@@ -218,8 +218,7 @@ namespace MultiplayerSample
                     float damage = effect.m_hitMagnitude * powf((effect.m_hitFalloff * (1.0f - hitDistance / maxDistance)), effect.m_hitExponent);
                     float damage = effect.m_hitMagnitude * powf((effect.m_hitFalloff * (1.0f - hitDistance / maxDistance)), effect.m_hitExponent);
 
 
                     // Look for physics rigid body component and make impact updates
                     // Look for physics rigid body component and make impact updates
-                    NetworkRigidBodyComponent* rigidBodyComponent = entityHandle.GetEntity()->FindComponent<NetworkRigidBodyComponent>();
-                    if (rigidBodyComponent)
+                    if (Multiplayer::NetworkRigidBodyComponent* rigidBodyComponent = entityHandle.GetEntity()->FindComponent<Multiplayer::NetworkRigidBodyComponent>())
                     {
                     {
                         const AZ::Vector3 hitLocation = hitInfo.m_hitEvent.m_hitTransform.GetTranslation();
                         const AZ::Vector3 hitLocation = hitInfo.m_hitEvent.m_hitTransform.GetTranslation();
                         const AZ::Vector3 hitDelta = hitEntity.m_hitPosition - hitLocation;
                         const AZ::Vector3 hitDelta = hitEntity.m_hitPosition - hitLocation;
@@ -228,8 +227,7 @@ namespace MultiplayerSample
                     }
                     }
 
 
                     // Look for health component and directly update health based on hit parameters
                     // Look for health component and directly update health based on hit parameters
-                    NetworkHealthComponent* healthComponent = entityHandle.GetEntity()->FindComponent<NetworkHealthComponent>();
-                    if (healthComponent)
+                    if (NetworkHealthComponent* healthComponent = entityHandle.GetEntity()->FindComponent<NetworkHealthComponent>())
                     {
                     {
                         healthComponent->SendHealthDelta(damage * -1.0f);
                         healthComponent->SendHealthDelta(damage * -1.0f);
                     }
                     }

+ 5 - 5
Gem/Code/Source/Components/WasdPlayerMovementComponent.cpp

@@ -8,7 +8,7 @@
 #include <Source/Components/WasdPlayerMovementComponent.h>
 #include <Source/Components/WasdPlayerMovementComponent.h>
 
 
 #include <Source/Components/NetworkAiComponent.h>
 #include <Source/Components/NetworkAiComponent.h>
-#include <Source/Components/NetworkCharacterComponent.h>
+#include <Multiplayer/Components/NetworkCharacterComponent.h>
 #include <Source/Components/NetworkAnimationComponent.h>
 #include <Source/Components/NetworkAnimationComponent.h>
 #include <Source/Components/SimplePlayerCameraComponent.h>
 #include <Source/Components/SimplePlayerCameraComponent.h>
 #include <Multiplayer/Components/NetworkTransformComponent.h>
 #include <Multiplayer/Components/NetworkTransformComponent.h>
@@ -146,21 +146,21 @@ namespace MultiplayerSample
         float speed = 0.0f;
         float speed = 0.0f;
         if (wasdInput.m_crouch)
         if (wasdInput.m_crouch)
         {
         {
-            speed = GetNetworkCharacterComponentController()->GetCrouchSpeed();
+            speed = GetCrouchSpeed();
         }
         }
         else if (fwdBack < 0.0f)
         else if (fwdBack < 0.0f)
         {
         {
-            speed = GetNetworkCharacterComponentController()->GetReverseSpeed();
+            speed = GetReverseSpeed();
         }
         }
         else
         else
         {
         {
             if (wasdInput.m_sprint)
             if (wasdInput.m_sprint)
             {
             {
-                speed = GetNetworkCharacterComponentController()->GetSprintSpeed();
+                speed = GetSprintSpeed();
             }
             }
             else
             else
             {
             {
-                speed = GetNetworkCharacterComponentController()->GetWalkSpeed();
+                speed = GetWalkSpeed();
             }
             }
         }
         }
 
 

+ 0 - 9
Gem/Code/multiplayersample_files.cmake

@@ -8,12 +8,9 @@
 set(FILES
 set(FILES
     Source/AutoGen/NetworkAiComponent.AutoComponent.xml
     Source/AutoGen/NetworkAiComponent.AutoComponent.xml
     Source/AutoGen/NetworkAnimationComponent.AutoComponent.xml
     Source/AutoGen/NetworkAnimationComponent.AutoComponent.xml
-    Source/AutoGen/NetworkCharacterComponent.AutoComponent.xml
     Source/AutoGen/NetworkHealthComponent.AutoComponent.xml
     Source/AutoGen/NetworkHealthComponent.AutoComponent.xml
-    Source/AutoGen/NetworkHitVolumesComponent.AutoComponent.xml
     Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml
     Source/AutoGen/NetworkPlayerSpawnerComponent.AutoComponent.xml
     Source/AutoGen/NetworkRandomComponent.AutoComponent.xml
     Source/AutoGen/NetworkRandomComponent.AutoComponent.xml
-    Source/AutoGen/NetworkRigidBodyComponent.AutoComponent.xml
     Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml
     Source/AutoGen/NetworkWeaponsComponent.AutoComponent.xml
     Source/AutoGen/SimplePlayerCameraComponent.AutoComponent.xml
     Source/AutoGen/SimplePlayerCameraComponent.AutoComponent.xml
     Source/AutoGen/StressTestComponent.AutoComponent.xml
     Source/AutoGen/StressTestComponent.AutoComponent.xml
@@ -24,18 +21,12 @@ set(FILES
     Source/Components/NetworkAiComponent.h
     Source/Components/NetworkAiComponent.h
     Source/Components/NetworkAnimationComponent.cpp
     Source/Components/NetworkAnimationComponent.cpp
     Source/Components/NetworkAnimationComponent.h
     Source/Components/NetworkAnimationComponent.h
-    Source/Components/NetworkCharacterComponent.cpp
-    Source/Components/NetworkCharacterComponent.h
     Source/Components/NetworkHealthComponent.cpp
     Source/Components/NetworkHealthComponent.cpp
     Source/Components/NetworkHealthComponent.h
     Source/Components/NetworkHealthComponent.h
-    Source/Components/NetworkHitVolumesComponent.cpp
-    Source/Components/NetworkHitVolumesComponent.h
     Source/Components/NetworkPlayerSpawnerComponent.cpp
     Source/Components/NetworkPlayerSpawnerComponent.cpp
     Source/Components/NetworkPlayerSpawnerComponent.h
     Source/Components/NetworkPlayerSpawnerComponent.h
     Source/Components/NetworkRandomComponent.cpp
     Source/Components/NetworkRandomComponent.cpp
     Source/Components/NetworkRandomComponent.h
     Source/Components/NetworkRandomComponent.h
-    Source/Components/NetworkRigidBodyComponent.cpp
-    Source/Components/NetworkRigidBodyComponent.h
     Source/Components/NetworkWeaponsComponent.cpp
     Source/Components/NetworkWeaponsComponent.cpp
     Source/Components/NetworkWeaponsComponent.h
     Source/Components/NetworkWeaponsComponent.h
     Source/Components/SimplePlayerCameraComponent.cpp
     Source/Components/SimplePlayerCameraComponent.cpp

+ 64 - 64
Prefabs/4x4x4BoxGrid.prefab

@@ -230,7 +230,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -418,7 +418,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -606,7 +606,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -794,7 +794,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -982,7 +982,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -1170,7 +1170,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -1358,7 +1358,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -1546,7 +1546,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -1734,7 +1734,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -1922,7 +1922,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -2110,7 +2110,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -2298,7 +2298,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -2486,7 +2486,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -2674,7 +2674,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -2862,7 +2862,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -3050,7 +3050,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -3238,7 +3238,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -3426,7 +3426,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -3614,7 +3614,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -3802,7 +3802,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -3990,7 +3990,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -4178,7 +4178,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -4366,7 +4366,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -4554,7 +4554,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -4742,7 +4742,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -4930,7 +4930,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -5118,7 +5118,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -5306,7 +5306,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -5494,7 +5494,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -5682,7 +5682,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -5870,7 +5870,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -6058,7 +6058,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -6246,7 +6246,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -6434,7 +6434,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -6622,7 +6622,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -6810,7 +6810,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -6998,7 +6998,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -7186,7 +7186,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -7374,7 +7374,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -7562,7 +7562,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -7750,7 +7750,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -7938,7 +7938,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -8126,7 +8126,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -8314,7 +8314,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -8502,7 +8502,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -8690,7 +8690,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -8878,7 +8878,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -9066,7 +9066,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -9254,7 +9254,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -9442,7 +9442,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -9630,7 +9630,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -9818,7 +9818,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -10006,7 +10006,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -10194,7 +10194,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -10382,7 +10382,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -10570,7 +10570,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -10758,7 +10758,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -10946,7 +10946,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -11134,7 +11134,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -11322,7 +11322,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -11510,7 +11510,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -11698,7 +11698,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -11886,7 +11886,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {
@@ -12074,7 +12074,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 9450029410653326667,
                     "Id": 9450029410653326667,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkRigidBodyComponent"
+                        "$type": "Multiplayer::NetworkRigidBodyComponent"
                     }
                     }
                 },
                 },
                 "Component_[9452550092591643181]": {
                 "Component_[9452550092591643181]": {

+ 13 - 13
Prefabs/Player.prefab

@@ -102,18 +102,11 @@
                         "DeathParamName": "death_state_index"
                         "DeathParamName": "death_state_index"
                     }
                     }
                 },
                 },
-                "Component_[12008415632399015100]": {
-                    "$type": "GenericComponentWrapper",
-                    "Id": 12008415632399015100,
-                    "m_template": {
-                        "$type": "MultiplayerSample::WasdPlayerMovementComponent"
-                    }
-                },
                 "Component_[13362124592556856876]": {
                 "Component_[13362124592556856876]": {
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 13362124592556856876,
                     "Id": 13362124592556856876,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkHitVolumesComponent"
+                        "$type": "Multiplayer::NetworkHitVolumesComponent"
                     }
                     }
                 },
                 },
                 "Component_[14925070260434397195]": {
                 "Component_[14925070260434397195]": {
@@ -328,6 +321,17 @@
                     },
                     },
                     "AttachmentTarget": ""
                     "AttachmentTarget": ""
                 },
                 },
+                "Component_[5387953310772448141]": {
+                    "$type": "GenericComponentWrapper",
+                    "Id": 5387953310772448141,
+                    "m_template": {
+                        "$type": "MultiplayerSample::WasdPlayerMovementComponent",
+                        "WalkSpeed": 3.0,
+                        "SprintSpeed": 5.0,
+                        "ReverseSpeed": 2.0,
+                        "CrouchSpeed": 1.5
+                    }
+                },
                 "Component_[6252367322126438780]": {
                 "Component_[6252367322126438780]": {
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 6252367322126438780,
                     "Id": 6252367322126438780,
@@ -339,11 +343,7 @@
                     "$type": "GenericComponentWrapper",
                     "$type": "GenericComponentWrapper",
                     "Id": 7398251875150394377,
                     "Id": 7398251875150394377,
                     "m_template": {
                     "m_template": {
-                        "$type": "MultiplayerSample::NetworkCharacterComponent",
-                        "WalkSpeed": 3.0,
-                        "SprintSpeed": 5.0,
-                        "ReverseSpeed": 2.0,
-                        "CrouchSpeed": 1.5
+                        "$type": "Multiplayer::NetworkCharacterComponent"
                     }
                     }
                 },
                 },
                 "Component_[7411749707748254874]": {
                 "Component_[7411749707748254874]": {