![]() The result can be Promoted to a Variable and then passed on later for whatever other needs you may have for it.ĭoes this give you the desired functionality you wanted? With a Deproject Screen to World node you could get World Space if you need it. Now in On Drag Detected, you can drag from the Pointer Event and Get Screen Space Position on the mouse cursor. Now connect the output to the return out. Choose the Left Mouse Button (or whatever button you use to drag and drop!). In On Mouse Button Down, from Mouse Event, drag and create a node called Detect Drag If Pressed. ![]() On the Widget you’re dragging, go to the Graph view and next to Functions, click from the Override option the dropdown item called On Mouse Button Down. ![]() But when i Drag from the Widget, the is no mouse position to get. All is working, when I Click on an Actor in World Space or drag an Object on it From the World. When i drag the Inventory Item from the inventory into the world, i want to fire a LineTrace from that position & if it Hits an Actor start an Interace. Im using kind of an Inventory with objects in it. SceneView->DeprojectFVector2D(ScreenPos, /*out*/ WorldOrigin, /*out*/ WorldDirection) LocalPlayer->ViewportClient->EngineShowFlags) If (V.W GetWorldFromContextObject(WorldContextObject) įSceneViewFamil圜ontext ViewFamily(FSceneViewFamily::ConstructionValues( if behind the screen, clamp depth to the screen ResultVec.Y = (ScreenDimensions.Y / 2.f) + (resultVec.Y*(ScreenDimensions.Y / 2.f)) ResultVec.X = (ScreenDimensions.X / 2.f) + (resultVec.X*(ScreenDimensions.X / 2.f)) LocalPlayer->ViewportClient->GetViewportSize(ScreenDimensions) ULocalPlayer* LocalPlayer = GEngine->GetLocalPlayerFromControllerId(World, 0) įSceneViewFamil圜ontext ViewFamily(FSceneViewFamily::ConstructionValues(LocalPlayer->ViewportClient->Viewport, World->Scene, LocalPlayer->ViewportClient->EngineShowFlags).SetRealtimeUpdate(true)) įSceneView* SceneView = LocalPlayer->CalcSceneView(&ViewFamily, OutViewLocation, OutViewRotation, LocalPlayer->ViewportClient->Viewport) ![]() UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject) ![]() Or, because handling gameplay mechanics like input through the HUD is pants-on-head-pencils-up-the-nose retarded, you could use this code in your own project to give you projection / deprojection functions you can use from anywhere:įVector UMyGameplayStatics::Project(UObject* WorldContextObject, FVector Location) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |