[C++] How do I scale down mesh or scale up collider correctly?
Here's what it looks like when I constructed them by default:
And here's what it should look like in the editor when I changed the mesh's scale size to 0.5 for each axis. Note that I did this in "Simulate" mode in the UE4 Editor.
I don't know how to scale down the mesh, or scale up the USphereComponent by 50% of its original scale value.
This is how it looks in my code:
I had tried to use
What am I doing wrong? Thanks in advance.
asked Apr 09 '15 at 03:08 AM in C++ Programming
You code is in the class constructor, mainly this sets the "default" value for your object when you put it in your scene. SetWorldScale3D and SetRelativeScale3D will both work, if you use them inside BeginPlay() or OnConstruction() function.You can override these like so:
The BeginPlay() function will be called when the game starts. The OnConstruction() function is called whenever you change a property to the object. This include in the editor, so if you want this to be applied while in the editor, you can do that there.
So, for example, you can do that to do your scaling :
Also, you don't need to use "this->" everywhere, it's not necessary.
answered Apr 09 '15 at 03:00 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here