G
G
Georgy Khasanov2020-10-27 10:05:25
C++ / C#
Georgy Khasanov, 2020-10-27 10:05:25

Why do stripes appear on a UE4 C++ object?

Stripes appear on the object when approaching the surface, if it is added via c ++. How to fix it?
Object code:

#include "Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h"
#include "Components/BoxComponent.h"
#include "PortalIn.h"

APortalIn::APortalIn()
{
  PortalIn = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("PortalIn"));

  PortalIn->SetupAttachment(RootComponent);

  static ConstructorHelpers::FObjectFinder<UStaticMesh> PortalIn_Mesh(TEXT("StaticMesh '/Game/StarterMap/Shapes/PortalIn.PortalIn'"));

  PortalIn->SetStaticMesh(PortalIn_Mesh.Object);
  PortalIn->SetRelativeLocation(FVector(0.0f, 0.0f, 0.0f));
  PortalIn->SetWorldScale3D(FVector(1.0f));

  PrimaryActorTick.bCanEverTick = true;
}

void APortalIn::BeginPlay()
{
  Super::BeginPlay();
  
}

void APortalIn::Tick(float DeltaTime)
{
  Super::Tick(DeltaTime);

}

cb3vyvwfb1jq_izovl5l-i3jujs.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Georgy Khasanov, 2020-11-01
@c0mbat-un1t

To solve this problem, in the settings of the Transform object, the Mobility parameter must be set to Static.sz-3nigbcrkygf1xzw_rdcqb_sy.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question