I’m having some trouble understanding how to use CharacterMovement->IsInWater. I’m trying to use it to swim upwards when jumping if I’m inside a physics volume marked as water, but the compiler complains when I use it like this:
void AMyCharacter::OnStartJump()
{
if (CharacterMovement->IsInWater == true) //if the player is in water...
{
const FRotator Rotation = Controller->GetControlRotation();
const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::Z);
//swim up
AddMovementInput(Direction, 1.0f);
}
else
{
bPressedJump = false;
bPressedJump = true;
}
}
void AMyCharacter::OnStopJump()
{
bPressedJump = false;
}
I’m pretty green when it comes to C++, so it might be something really obvious. This is the error the compiler throws: 1>------ Build started: Project: MyGame, Configuration: Development_Editor x64 - - Pastebin.com
Any help would be immensely appreciated.