I created this logic and I am accessing the Data table Directory everytime to access its directory, so my Question is it not possible to access its rows using the already declared pointer to the data table called row
if (_bCrouching)
{
if (!_bHoldWeapon && (MoveForwardAxis != 0.0f || MoveRightAxis != 0.0f))
{
//Get the Camera height row from data table of Camera Height Row and set the value to the new height from this.
if (const UDataTable* DT_CameraHeight{ LoadObject<UDataTable>(GetWorld(), TEXT("DataTable'/Game/Blueprints/BP_DataTables/Camera/DT_CameraHeight.DT_CameraHeight'")) })
{
//Set camera height for crouch normal move
if (const FST_CameraHeight* Row{ DT_CameraHeight->FindRow<FST_CameraHeight >("Crouch_Normal_Move", "") }) //60
{
_NewHeight = Row->Height;
printf("The new value for NewHeight from Crouch_Normal_Move is: %f", _NewHeight);
}
}
else
{
if (_bHoldWeapon && (MoveForwardAxis != 0.0f || MoveRightAxis != 0.0f))
{
//Get the Camera height row from data table of Camera Height Row and set the value to the new height from this.
if (const UDataTable* DT_CameraHeight{ LoadObject<UDataTable>(GetWorld(), TEXT("DataTable'/Game/Blueprints/BP_DataTables/Camera/DT_CameraHeight.DT_CameraHeight'")) })
{
//Set camera height for crouch Rifle move
if (const FST_CameraHeight* Row{ DT_CameraHeight->FindRow<FST_CameraHeight >("Crouch_Rifle_Move", "") }) //80
{
_NewHeight = Row->Height;
printf("The new value for NewHeight from Crouch_Rifle_Move is: %f", _NewHeight);
}
}
}
}
}
}