[UE 4.5] A few questions about programming

Hi I working on isometric game project and i have a few questions. How to get mouse position spawn actor or particle on mouse position, and how to attach actor to socket in skeletal mesh? Sorry for my english and thanx for all answers.

are you trying to do this via c++ or blueprrints?

C++ I am a beginner and still learn the tricks used for the needs of the engine.

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