How do I set transform position of component in code c++
Hi all, another noob question.
I am making a USceneComponent and attaching it to the Mesh in my class inherited from ACharacter
Next I want to set its default position to be in front of the character face. This is what I tried
It did not work. This is how I checked.
As you can see in this view. I have a lookAtPoint made in the blueprint level so that I can adjust the the position. However the myLookAtPoint that I made in code does not have any editable options.
All in all I just want to be able to make components and read their world location in c++ code. However I can't even get the instantiation of components right, why is this so hard?!.
Don't set the position in code. Attach it to a socket; MyLookAtPoint->AttachTo(Mesh, "look_at_mount");
Compile that, then go in to the mesh and make a socket called "look_at_mount". You can use this tutorial, for example, to see how to do that; https://www.youtube.com/watch?v=-xOoknUDGaE
You can then position the mesh exactly where you want it by hand, in the character BP. I'm not clear on the rest of your question- are you having problems finding the location of this component during run time?
answered Nov 15 '14 at 07:37 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here