Hello, so i was just wondering how i can make a simple ray cast within UE4 say for like weapons or AI? also some examples would be great! i seen a few other posts but the answers weren’t very clear so i was hoping to get some clarity with this
hey thanks that was really helpful! so somthing like this would work?
#define COLLISION_TRACE ECC_GameTraceChannel1
FHistResult Hit;//the thing that is an output of the statement
FCollisionQueryParams Line(FName("Collision param"),true);
World->LineTraceSingle(Hit, this->Location /*cant remember the actual name for the variable :/ */, this->RelativeLocation.X += 100,COLLISION_TRACE,Line);
AEnemy* enemy = Cast<AEnemy>(Hit.GetActor());
if(enemy){
enemy->Destroy();
}
thank you very much for your help really appreciate it