Ok, but despite the fact that i have changed the code, the error is still the same.
// Fill out your copyright notice in the Description page of Project Settings.
include “MyGameInstance.h”
include “Kismet/GameplayStatics.h”
include "Runtime/Engine/Classes/Components/StaticMeshComponent.h "
include “PhysicalMaterials/PhysicalMaterial.h”
include “BCRouge.h”
// Sets default values
ABCRouge::ABCRouge()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don’t need it.
PrimaryActorTick.bCanEverTick = true;
BCRougeMeshPhys = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("Skeletal Mesh Comp Phys"));
BCRougeMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Static Mesh Comp"));
UStaticMesh* SphereMesh = ConstructorHelpers::FObjectFinder<UStaticMesh>(TEXT("StaticMesh'/Engine/BasicShapes/Sphere.Sphere'")).Object;
BCRougeMesh->SetStaticMesh(SphereMesh);
BCRougeMesh->SetSimulatePhysics(true);
BCRougeMesh->SetEnableGravity(false);
BCRougeMeshPhys->SetPhysMaterialOverride(PhysMat);
BCRougeMesh->SetPhysMaterialOverride(PhysMat);
//line 27 and before : PhysMat->Friction = 0;
BCRougeMovement = CreateDefaultSubobject<UProjectileMovementComponent>(TEXT("ProjectileMovementComp"));
BCRougeMovement->InitialSpeed = 800;
BCRougeMovement->MaxSpeed = 8500;
BCRougeMovement->Bounciness = 1;
BCRougeMovement->Friction = 0;
BCRougeMovement->Velocity = (FVector(0.f, -1.f, 0.f));
//RootComponent = BCRougeMovement;
RootComponent = BCRougeMesh;
}
// Called when the game starts or when spawned
void ABCRouge::BeginPlay()
{
Super::BeginPlay();
//ConstructorHelpers::FObjectFinder<UStaticMeshComponent>MeshRef(TEXT("Game/ThirdPerson/Meshes/CubeMesh.CubeMesh"));
//BCRougeMesh->SetStaticMesh(MeshRef);
//ConstructorHelpers::FObjectFinder<UStaticMesh>MeshAsset(TEXT("StaticMesh'/Game/CubeMesh.CubeMesh"));
//UStaticMesh* Asset = MeshAsset.Object;
//BCRougeMesh->SetStaticMesh(Asset);
}
// Called every frame
void ABCRouge::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
UMyGameInstance* MyGameInstance = Cast<UMyGameInstance>(UGameplayStatics::GetGameInstance(GetWorld()));
if (MyGameInstance)
{
//MyGameInstance->PointBalle2++;
}
}