Is anyone else getting this issue? I can reproduce this 100% of the time. Playing in the Editor, I have C++ code that calling Other->GetName() using the parameters from the NotifyHit function. It appears that when attempting to call GetName() when a collision occurs with a Brush (as opposed to a Static Mesh) causes the Editor to crash. I’m trying to work on some wall jumping and this is what I came across.
float AVideoGameCharacter::GetAngle(FVector Vector1, FVector Vector2)
{
Vector1.Normalize();
Vector2.Normalize();
float result = FMath::RadiansToDegrees(acosf(FVector::DotProduct(Vector1, Vector2)));
return result;
}
void AVideoGameCharacter::NotifyHit
(
class UPrimitiveComponent * MyComp,
AActor * Other,
class UPrimitiveComponent * OtherComp,
bool bSelfMoved,
FVector HitLocation,
FVector HitNormal,
FVector NormalImpulse,
const FHitResult & Hit
)
{
Super::NotifyHit(MyComp, Other, OtherComp, bSelfMoved, HitLocation, HitNormal, NormalImpulse, Hit);
float angle = GetAngle(HitNormal, FVector::UpVector);
if (angle >= 45 && angle <= 90)
{
if (Other->GetName().Contains("Wall")) // THIS LINE RIGHT HERE!
{
touchingGrabbableWallState = 2;
if (isGrabbing && GetCharacterMovement()->IsFalling())
{
GetCharacterMovement()->GravityScale = .2f;
}
}
}
}