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)
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); }
You are the best. Giving effort and giving awesome info.
Thanks for making this playlist.
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)
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);
}