Why does GetOverlappingActors not return Landscape
Hello, I am currently trying to code a component which will manage the GroundFriction for the character by getting the friction value from any static objects that the character is currently touching. In order to do this, I am using the GetOverlappingActors method. This seems to work fine for my needs. But for some reason, the function seems to e ignoring Landscape objects. This is problematic, since the majority of the friction surfaces will be Landscape objects.
Why does GetOverlappingActors not return Landscape objects?
Is there a better function to use? Or is there something that I might be missing?
Thanks in advance.
asked May 07 '15 at 02:04 AM in C++ Programming
I would personally do a trace to determine what your actor is currently touching. I do not know exactly why the GetOverlappingActors() would not return the landscape, but sure is not a good way to go for your wanted behavior, since you can have more than one overlapping actor.
Basically the idea would be to do a trace from your actor position to the ground.
You can see a good example of that in that other post :
What is interesting here is this :
I personnaly prefer this one:
bool UWorld::LineTraceSingle(struct FHitResult& OutHit,const FVector& Start,const FVector& End,const struct FCollisionQueryParams& Params, const struct FCollisionObjectQueryParams& ObjectQueryParams)
In Start, you want to use : GetActorLocation() => Your actor location
In End, I imagine you would use this: GetActorLocation() + FVector(0.0f,0.0f,-1000.0f) => Your actor location minus 1000 unit downward.
You can declare "default" FCollisionQueryParams and FCollisionObjectQueryParams to pass here.
Hope this helps :)
answered May 07 '15 at 03:24 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here