DOTS Character NPCs

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024
  • เกม

ความคิดเห็น • 4

  • @casproduksiyoncasoyun4497
    @casproduksiyoncasoyun4497 ปีที่แล้ว

    You are the best. Giving effort and giving awesome info.

  • @andywatts
    @andywatts 8 หลายเดือนก่อน

    Thanks for making this playlist.

  • @MythDjinn
    @MythDjinn 7 หลายเดือนก่อน

    thanks for the tutorials. would be great to get one where the camera turns into action mode. (players rotation is froze but moves side to side and forward, with the camera facing player forward direction)

    • @MythDjinn
      @MythDjinn 7 หลายเดือนก่อน

      for those that want a start on fixing the players rotation to camera.
      i created a new float3 called FixedRotation in characterControl (ThirdPersonCharacterControlComponent.cs)
      [Serializable]
      public struct ThirdPersonCharacterControl : IComponentData
      {
      public float3 MoveVector;
      public float3 FixedRotaion;
      public bool Jump;
      }
      --------------------------------------------------------------------
      in ThirdPersonPlayerFixedStepControlSystem.cs
      characterControl.FixedRotaion = cameraForwardOnUpPlane;
      // Move
      characterControl.MoveVector = (playerInputs.MoveInput.y * cameraForwardOnUpPlane) + (playerInputs.MoveInput.x * cameraRight);
      -----------------------------------------------------------------------------
      in ThirdPersonCharacterAspect.cs around where this code is changed the MoveVector to FixedRotation
      //if (math.lengthsq(characterControl.MoveVector) > 0f)
      {
      CharacterControlUtilities.SlerpRotationTowardsDirectionAroundUp(ref characterRotation, baseContext.Time.DeltaTime, math.normalizesafe(characterControl.FixedRotaion), MathUtilities.GetUpFromRotation(characterRotation), characterComponent.RotationSharpness);
      }