[Bug Report] "SetRelativeLocation" inside blueprint component hierarchy, sets the world location instead

If you create a parent-child hierarchy inside blueprint component in UE4 V4.3. The function SetRelativeLocation sets the world location instead.

In my case, I have a blueprint with the following components hierarchy:

Billboard component as root
----> scene component as root child
-------->static mesh component as scene component child

If I understand the Set/Get relative location functions currently, it should Set/Get the local location of the component relative to its parent. If it is so, there is a bug with SetRelativeLocation in which it behaves like SetWorldLocation function and sets the world location of component.

Hi yRezaei,

I just tested this in 4.3.1 and it is working correctly. Try setting up your blueprint like below and testing this out.

What should happen is when 1 is pressed the ‘Set Relative Location’ will set the static mesh to the 0,0,0 of it’s parent component. And when 2 is pressed the ‘Set World Location’ will set the static mesh to the 0,0,0 of the level.

12726-ahub_setrelativelocation.jpg

I did it, but No. I am also using 4.3.1.
Please have look the bellow instraction:

https://dl.dropboxusercontent.com/u/83781270/UE4/Root.PNG

https://dl.dropboxusercontent.com/u/83781270/UE4/Root2.PNG

https://dl.dropboxusercontent.com/u/83781270/UE4/Root3.PNG

https://dl.dropboxusercontent.com/u/83781270/UE4/Blueprint.PNG

https://dl.dropboxusercontent.com/u/83781270/UE4/Editor.PNG

If I am misunderstanding please correct me. It looks like the Chair’s pivot snaps to the Parent Target Location (X 0, Y 0, X 140) when you press G. Is that correct?

The root location is (0,0,0), the “Target_location” location is (0,0,140) and the static mesh (SM_chair) location is (0,0,-100) relative to its parent “Target_location” .

The blueprint “BP_SM_Chair” is located at (-270, 0, 32) inside the world. When I press G, the static mesh is suppose to move to (0,0,140) relative to root inside Blueprint, but in my case it moves to (0,0,140) of the world.

I suppose the overall hierarchy should be like bellow:

->Main Scene (World)
------>BP_SM_Chair (-270, 0, 32) relative to the world
----------->Root (0,0,0) Relative to BP_SM_Chair world location
---------------->Target_location (0,0,140) relative to root
----------------------->StaticMesh (SM_Chair) (0,0,-100) relative to Target_location

When I Set the relative location of static mesh to (0,0,0) it should move relative to Target_location which means it should have (0,0,140) location relative to Root and respectively (-270, 0, 32+140) relative to the world.

I mean, it completely ignores the BP_SM_Chair location.

I attempted to reproduce this several times in a couple of new projects and can’t get your results. My child mesh will always move to the center of it’s parent component (which I have set to (0,0,140).

Have you tried reproducing this in another new project yet?

Yes, “SetRelativeLocation” works currently. But, not in that PC and UE4 editor which I was working with first. I just checked it in another PC and it worked perfectly.

I have no idea what is going on with that UE4 editor. I update them both at the same day.

I am really sorry about taking your time TJ. I should check this issue in another editor first then ask it.

Thanks a lot for your quick response.

It’s not a problem. I would suggest re-installing the editor on that PC. It’s a very strange issue made even stranger by being only reproducible on one PC.

If you figure out what it was or if it corrects with re-install, please post back and let us know.

Thanks, TJ

Dear TJ
I removed the editor completely and re-installed the v4.4. I checked the case once again and it works fine.

I am not sure, but I have the compiled version of the source code in this PC, and I switched a lot between them since I needed to add some extra File I/O code. I don’t think these two (installer version and source code version) can effect each other, but this was the only thing that I did during last week.

Anyway, If I could reproduce that case again, I will inform you.