I need a Help on one thing that is taking me months to find a solution. I created a Hud where I display some buttons, and one of this buttons shows an iccon of one actor that can be spawned. The problem is that I want this actor to spawn at mouse location, when I do a hit box end cursor over, and I couldn’t make it to spawn the actor on the mouse position yet. Any help on this please? Is something similar to Clash Of Clans construction of villages
Break it down into steps , first when the user clicks the character icon , get it to close the widget so that you can see the level again,
then get the mouse position and store this in a vector variable,
lastly spawn actor at location use the make transform node and link it to the mouse position vector you created earlier .
This will spawn the actor at the location of the mouse when the variable was saved .
If you wanted it to update as the mouse moved then you would probably need an event tick that continually updates the mouse position vector variable .
Or there might even be an event that already exists like “onMouseMoved” inside here you could make it get the mouse position and save it so this way it would only be called if the mouse moves rather then every frame(event tick)
I created this HUD with HUD class, not UMG, the box icon is drawn with a hitbox
Oh I see then I can’t help you sorry , I’ve never used hud and don’t think I will . UMG widgets do everything a hud does but just easier and more options to customise it.
Apparently UMG doesnt work in VR(stereo), so theres a pat on the back for regular boring old HUDS
I did a tutorial for this very thing. Take a trip to my blog and look for the post entitled “Hud to Scene Interaction”. I even used the old HUD class for it. (made before UMG) Hopefully it’ll help.
I worked with UMG to make the start menu, and I noticed that it doesn’t give much event options to the buttons you draw, like event hit begin, hit release, begin touch, leave touch, etc…
I will take a look on your blog when I get to my computer
Hey pattym, I worked a little on this and the result I got is this:
I have 5 spawnable actors that I switch between the icons on my Hud Hitbox, the first actor showed in the Icon spawns at XYZ= 0 on the grid, but if I drag the mouse to the grid the actor follows it, as if had spawned in the pointer position, I’m ok with that, but the other 4 actors spawns at the Pawn location (that I created just to move the camera around) and I have to grab the actor for it to folow the pointer position. the spawn location that I used is like this:
Any help on this?
I just need to finish this to get my game done, oh, and also testing it on android and IOS, that is another problem that I have because I’m getting erros when packing it.
Bump? Still looking for a sollution for a problem that seems simple to resolve
Here’s a link to a problem I have but it contains my blueprints which pretty much do what you want. I hope it helps. Especially blueprints 1 (spawn actor) and 2 (follow mouse). Blueprint 3 is to drop the actor.
And if you can help with my problem…even better.