[UE 4.5] A few questions about programming

okay, to get the mouse position in c++ there is a simple function:

the two parameters are references which means the variables you pass to them are modified.

with this information you can do a line trace to find what is actually under the cursor:

i have written the if statement over multiple lines to make it easier to read as i don’t have a widescreen monitor. the first parameter is another reference so you dont need to modify HitResult. the second is the start position of the line trace and the third is the end position (the large number is the distance). the next parameter is the channel the trace uses to detect a hit you may need to read up about collision and trace channel in unreal engine and the last isnt really important but you can read more about it by searching for it on the documentation site

that if statement will be true if something is hit and false otherwise. inside that if statement is where you spawn your particles.

as for attaching actors to mesh sockets ill have to look it up a bit more as i only have a rough idea about it. ill get back to you on that.

I believe this was the function i used when i attached something to a socket a while ago: https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/AActor/AttachRootComponentToActor/index.html