Object that follows mouse position. How to properly do it with BP?
I try to make simple BP where my actor object will follow mouse position. So I've done it with the simple BP:
but when I run it I get some "inverted" position of my actor. Why is it work like this? I've recorded a video: https://www.youtube.com/watch?v=bvsDagxM3Ns
You are using the mouse location node incorrectly. try something more like this to see how it would work:
It is unclear what you are truly attempting to do, and as OrchestralMusician stated you may actually want to use the get hit result but i wanted to post a example of the mouse location node you were using.
answered Jun 21 '15 at 11:14 PM
Try using "Get HitResult under Cursor". This outputs a HitResult from which you can take the position on your map and make your actor move there.
Convert Mouse Location doesn't project the location to the world and I generally had a lot of issues with that.
answered Jun 21 '15 at 01:24 PM
To those who may come across this thread in the future. I found a number of issues with Convert Mouse Location to World Space and Get Hit Results Under Cursor by Channel. For most interactions of this nature (where you are trying to place a Building on the Floor for example) - try using Get Hit Results Under Cursor by Object.
Set your Object Trace to what you want to trace for (World Static in most use cases) and it will consistently return the floor location. The biggest issue with the other options that they will trace to the building you are trying to place (thereby defeating the point, you are trying to hit the floor, not what you just spawned) or move the object all over the screen and not the floor where you are trying to place it.
If you're stuck like I was, give Get Hit Results Under Cursor by Object. a try and see if that suits your use case.
answered Mar 28 '16 at 01:39 AM
I think this is what you are looking for:
All you need to do is change the break vectors to the direction you are facing (X,Y,Z) I don't think +/- matter
Here is a text you you can copy-paste into the BP: Paste
Also, you can subtract your first break vector float you chose by an amount if you want to use less of the viewport to move the mesh (by default it will use the viewport bounds for the movable units, so if the viewport is1920, the mesh will move -960 to 960 units)
Follow this question
Once you sign in you will be able to subscribe for any updates here