Most of the code can be ignored and complies fine but the final line of the GetWorld()->LineTraceSingleByChannel(
FCollisionQueryParams(ECollisionChannel::ECC_Camera), returns :
no instance of constructor matches the argument list argument types are: (ECollisionChannel)
So how can I re-write this to work on UE5? would appreciate any help
What is this supposed to be, anyway? I can’t see any CollisionChannel parameters neither in FCollisionQueryParams constructors, nor in the FCollisionQueryParams struct itself. If you want to setup custom parameters, declare it before the trace and set it up; otherwise just remove the Params altogether, there’s a default value anyway.
So either:
FHitResult HitResult;
FCollisionQueryParams Params;
// Set Params Here
GetWorld()->LineTraceSingleByChannel(HitResult, Start, End, ECollisionChannel::ECC_Camera, Params);
Having looked up the documentation part of the doc for ue5 seems removed vs ue4 but it still seems to include both, but it seems for whatever reason Params whatever it does no longer accepts a eclollsionchannel type value by default, so wondered if there was some other way to go about it without manually overloading it, it is true in mean time i simply removed params to make it compile, but unsure if i stripped any functionality from it to do so, hence the question here.
I do get the impression this was probably done by a college student as part of their studies, so not sure if he/she/it/goat entirely knew what they was doing either, but probably more so than me as I not touched UE code in several versions(since ue3) time xD, so it seemed easier to pull in this code and modify it then try to write one myself from scratch, and where I to write one from scratch I would benefit from fully understanding this first in either case.