Unreal crashes when i press play

After tutorial no 188 i just press the play button just to make sure if every thing compiled right but when i press the button UE crashes plz help thanks in advance

You are most likely dereferencing a null pointer. What code have you added for that lecture?

auto Barrel location = Barrel->GetComponentLocation().ToString();

That would imply Barrel is a null pointer. Did you make sure to set it in blueprint using SetBarrelReference?

Where should i set it in c++ or in ue

void UTankAimingComponent::SetBarrelReference(UStaticMeshComponent* BarrelToSet)
this->Barrel = BarrelToSet;

i’ve already set in c++

That’s the code that will set it. It’s not going to set it if you don’t call it and that is done in blueprint.

In which file should i set it

The tank blueprint.

i can’t find where

See around 7:18 in the lecture.

Thanks that solves my problem i actually some how missed that part

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms