DOTS Character NPCs

Поділитися
Вставка
  • Опубліковано 6 січ 2025

КОМЕНТАРІ • 4

  • @casproduksiyoncasoyun4497
    @casproduksiyoncasoyun4497 Рік тому

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

  • @andywatts
    @andywatts 9 місяців тому

    Thanks for making this playlist.

  • @MythDjinn
    @MythDjinn 8 місяців тому

    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 8 місяців тому

      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);
      }