Download

Centering the 3D Model in Named Slot Viewport

Hi Everyone.

I have a Blueprint Widget that I use to show the buildings that the player can place in the world depending on some criteria, when the user selects one of the buttons the Idea is to center the spawned actor in the place that the named slot shows in the next Image:

104635-widget.png

This is done by passing the location of the Slot inside the widget using the next blueprint to a C++ Function:
104636-blueprint.png

But I’m not a 100% percent sure if that is actually giving me the location I want of the viewport for that slot and it’s centered position…

But it still creates and shows the spawned building in the game but it shows it in a wrong position, so here are some screens of this.

The spawned building should appear inside the red square:
104640-not inside of slot.png

But it appears in a wrong location (well whe could actualli say it’s the right location determined by the viewport position, but like in the image before I want to make it appear inside of the named slot), has shown in this image:
104638-it's way up on the z value.png

Any help so I can solve this it would be great, or any other idea on how I could tackle this would be great.