Component of Blueprint doesn't return correct position

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:
Hierarchy

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:

Basically it returns a wrong value of the relative position of the mesh. What am I doing wrong?

This in the Construction Script, right?

While not a consolation, I must admit I’ve seen components not updating properly more than often. :expressionless:

Thread:

And the bug:

1 Like

This is when you double click the blueprint in the level, isn’t it? You can move the components around independently.

I don’t actually know what that’s for, it has no actual effect on the BP.

If you want to move and scale the mesh after placing the BP in the level, you’ll need to do it in the construction script. Then it works.

The Blueprint is built in the Construction Script, and it behaves like I wrote. Is there a workaround or some solution?

How are you moving the plane after placing the BP in the level?

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.

I made this. An arrow with a plane

and I set the plane position in construction

( default is 200,0,0 ). I expose the variable and give it a widget

image

THEN, I can move the plane around, and the BP knows about it

plane

2 Likes

Ok got it, I’ll try to implement something similar myself, thank you for your help

1 Like