TL;DR: A mesh inside a camera inside a Blueprint returns a wrong value of its relative position. It returns the default value of the position the mesh has inside the blueprint, despite the mesh in the level is in another position.
Hello. I’m working with Blueprints trying to create a personal tool that matches a plane to the ViewFrustum of a camera. The tool contains a CineCamera and a Mesh (a plane, called here Backdrop). The Hierarchy is the following:
I need to get the distance between the camera and the mesh, and to achieve that I got their world position with Get World Location node for both. For debugging purposes I attached a Print String to monitor the results. The Blueprint is the following:
When I work in the viewport of the Blueprint, everything works (the plane is matched to the camera view frustum AND when I drag the plane around, it scales correctly):
When I put the Blueprint in my level, it stops working. If I try to move the plane around, it doesn’t scale correctly and even more it doesn’t even print a string of its position.
If I instead drag the whole Blueprint around, it correctly prints (here I changed the Get World Location node with a Get Relative Transform node) but it stays at a 100 value (the blueprint default) despite of how much I drag it around:
Double clicking it (or clicking it in the component list after selecting the blueprint) and dragging it around. I also found out that if I add a variable that adds or sets the plane position, it works correctly, but I still can’t drag around the plane without breaking it
This is what I’m saying. You can move the components of a BP around like that, but I think all it’s for is to make it look nice. It won’t affect any of the locations as far as the BP is concerned.