thanks for the help… for the understanding…
i call with InputTag this function
void ALyraCharacter::ToggleMantle()
{
Jump();
}
Character are jumping
and then i call this function
void ALyraCharacter::ToggleMantle()
{
if (ULyraCharacterMovementComponent* LyraMoveComp = CastChecked<ULyraCharacterMovementComponent>(GetCharacterMovement()))
{
LyraMoveComp->LyraMantle();
}
}
void ULyraCharacterMovementComponent::LyraMantle(bool bClientSimulation)
{
LyraCharacterOwner->Jump();
}
Character are jumping and AddImpulse are also work (because only the client call this its flip back)
and then i call how i implement it
void ALyraCharacter::ToggleMantle()
{
if (ULyraCharacterMovementComponent* LyraMoveComp = CastChecked<ULyraCharacterMovementComponent>(GetCharacterMovement()))
{
LyraMoveComp->bLyraWantsToMantle = true;
}
}
void ULyraCharacterMovementComponent::UpdateCharacterStateBeforeMovement(float DeltaSeconds)
{
if (LyraCharacterOwner->GetLocalRole() != ROLE_SimulatedProxy)
{
const bool bIsMantleing = LyraIsMantleing();
if (bIsMantleing && !bLyraWantsToMantle)
{
LyraUnMantle(false);
}
else if (!bIsMantleing && bLyraWantsToMantle)
{
LyraMantle(false);
}
}
Super::UpdateCharacterStateBeforeMovement(DeltaSeconds);
}
void ULyraCharacterMovementComponent::LyraMantle(bool bClientSimulation)
{
LyraCharacterOwner->Jump();
}
Character are not Jump or AddImpulse
how I would AddImpulse implement it
void ULyraCharacterMovementComponent::LyraMantle(bool bClientSimulation)
{
AddImpulse (FVector(0.0f, 1000.0f, 0.0f), true);
}
it looks that UpdateCharacterStateBeforeMovement broke it but i dont know why
Don’t misunderstand the function is called, I made sure of this using print screen…
Another thing to know is that I use safe variables and flags