Hello
This should be a simple problem but i cant get how to strafe my character relative to entity orientation. I can move backward, forward and rotate. But not strafe.
I want to move along the red arrow on the character. In my MonoBehaviour version i used translate.

public class CharacterControllerSystem : SystemBase
{
protected override void OnUpdate()
{
float deltaTime = Time.DeltaTime;
Entities.ForEach((ref PlayerControllerComponent player, ref Translation translation, ref Rotation rotation) =>
{
quaternion direction = quaternion.RotateY(90f);
translation.Value = translation.Value + (player.inputVertical * math.forward(rotation.Value)) * 5f * deltaTime;
translation.Value = translation.Value + (player.inputHorizontal * ? * 5f * deltaTime; //Strafe
if (player.leftKey)
{
player.currentRotation = player.currentRotation - 2f * deltaTime;
rotation.Value = quaternion.RotateY(player.currentRotation);
}
if (playerControllerComponent.rightKey)
{
player.currentRotation = player.currentRotation + 2f * deltaTime;
rotation.Value = quaternion.RotateY(player.currentRotation);
}
}).Schedule();
}
}
Any help is appreciated