LineTrace/Uworld?

Hey, I wanna know how to setup a Uworld class so I can start doing some linetrace(raycasting) through PhysX. I just wanna do it from the third person controller to what ever it hits.

Here is the doc to UWorld::LineTraceSingle

So is Uworld already there? Do I have to make a Uworld subclass?

Thanks in advance.

Or could i do it from the character through https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/AActor/ActorLineTraceSingle/index.html

#UWorld

Every UObject can now access UWorld!

Like so

Say you have a UObject Class, MyObj

You can do

UWorld* TheWorld = MyObj->GetWorld();
If(!TheWorld) return;
//~~~~~~~~~~~~~~~
//now you can use TheWorld
TheWorld->Functions

#TObjectIterator
If you dont have access to any UObjects in your current function context, use this

TObjectIterator<APlayerController> ThePC;
if(!ThePC) return;

UWorld* TheWorld = ThePC->GetWorld();

this finds the player controller that exists in the world

If you are doing in-editor physx stuff the above wont work

I assume you are doing this at game run time.

Rama