How can I set the Size of a Mesh using code?
Hey! I am having a few problems with setting the size and location of my mesh. For some reason, my Mesh (standard UE4 cube) is a lot bigger than my "collision component", but I already have all scale related variables set to "0". In addition, I wanted to ask how I can make the Mesh a child of the "collision component". Is what I have done okay? Because "collision component" doesn't have any sockets (its a UBoxComponent).
I also wondered if anyone can tell me why it takes so long for me to update the changes to my mesh. I always have to restart the program etc. which can be pretty frustrating, and even then the program usually doesn't recognise the changes I made.
Okay, I found out how to solve the problem. I added the following line (doubt that this was the defining factor):
Then I checked in the editor on my blueprint, and the following tab (the "transform" one) appeared, that had not been there previously (picture). Now I can even move the Mesh around in the blueprint as if I added it with the blueprint instead of script. Awesome!
answered May 09 '14 at 07:54 PM
Make a blueprint of your static mesh actor class
In the editor, go to the components tab
then you can fix everything up very easily
Then you can use C++ to spawn your BP, you can use my templated Spawn BP function to do this!
Manipulating the relationships between components is much easier to do in the editor, especially if you want to visualize what the actual issue is
once you find the solution you could go back to just C++ with greater understanding
Follow this question
Once you sign in you will be able to subscribe for any updates here