[Code] Can SetWorld...() naming scheme be changed to a consistent SetComponent...()?

For USceneComponents, we would have getter functions labeled as GetComponent…(). As in, GetComponentLocation(), GetComponentRotation(), etc.

This thread here discussed a bit that SetWorld…() function labels can be named consistently with its GetComponent…() counterparts. SetWorld…() may also be a bit confusing and jarring for those who wanted to set the variables that GetComponent…() refers to.

Would it be better to have a more consistent naming scheme for the setters, SetWorld…() to relate with the getters, GetComponent…()? Or a unified naming scheme?

Or this has been logged /declined before?

Hi asperatology,

Sorry for the delay in responding to your post. I’m not sure if this is something we can do very easily. The reason for that is that we currently have two different Set…() functions for components. Using location as an example, there is the SetWorldLocation() function, but we also have SetRelativeLocation(). They both accomplish the same thing; setting the location of the component. However, SetWorldLocation() sets the location of the component to a specific location in world space, whereas SetRelativeLocation() sets the location of the component in relation to its parent. If we just had simply SetComponentLocation(), would that be setting its location in world space or in relation to its parent? Some people would want it to work one way, some the other way, some won’t care as long as it works. But what if we choose to have it set the location relative to the component’s parent, and you now have a component that you want to place in a specific place in world space? We decided that it would make the Engine more flexible to have two different ways to set the location of a component, and we tried to name them in such a way that the function names would make it clear what the result would be.

Please don’t take this post as a dismissal of your suggestion. We are always open to discussions about ways to make things better in the Engine, and you are certainly welcome to provide feedback and/or suggestions at any time. I think this particular one may simply be unfamiliarity with the functions that are available, but you may also have a compelling reason for us to consider changing the name of one or more of these functions. If this is still a concern for you, please let us know.