Object that follows mouse position. How to properly do it with BP?

A trace from your camera through your mouse onto the world. The HItResult outputs as always what was hit, where, with what normal, etc.

Since you use the visibility channel and your actor has visibility it will if you click twice hit the actor and place it there instead. The fix is fairly simple. You use the hit result under cursor for objects and only insert “WorldStatic” into object types. With that it will only look for things which you set to static. By default that’s the normal environment but not a pawn etc. This is set in the collision settings of your actors. Just make sure that everything you might move is set to “WorldDynamic” or something besides"WorldStatic".

Like that it will ignore your actor and properly hit where you clicked on the ground.

1 Like