How do i connect 2 different pieces of code into the WPO?

I need to make a material for unit icons. This material is a symbol, and it must scale so to stay always the same size on the screen. And must also always face the camera (like a billboard).

For that, I have these 2 different WPO methods that i need to make happen at the same time, already done and working:
So again:

1- Billboard effect. Keeps the material facing the camera.
2- Keep scale. Keeps the scale of the material no matter how much you zoom in or zoom out.
They are both working well separately. They dont work when i try to combine both at the same time.

I tried Linear Interpolate, add, multiply. Nothing works. It just breaks one or the other.

Video:

Pls help.

1 Like

I think you need to scale before fiddling with the WPO. I couldn’t be bothered to copy all the code, but this seems to work

( the X vector of the mesh will face the camera, probably configurable ).

1 Like

Thats another method of making the material align to the camera.
Though i’m not being able to combine this one with the scale persistence either.
Here is the video:

Both methods work separately. I only need to combine them so that it faces the camera and also the scale persists.

What I gave above works :wink:

1 Like

Thats right. Its working, i just needed to replace the scale with the distance. And now its all done.
Thanks a lot.

1 Like

Actually i came accross an issue just today.
If the actor that contains the symbol rotates, then the symbol also rotates.
So the symbol only stays aligned to the camera if its on a specific rotation value.
The moment the containing actor rotates a bit. It gets messed up:

The original solution that i posted in this thread, self-adapted even if your actor rotates, but it didnt let me combine it with the scale too.

This is the original solution for the rotation of the material (aligns to camera no matter how your mesh is rotated in the world) :

Now i only need to make it scale. Thats the challenge.

I think I would do one of two things

  1. Just replace this item with a blueprint that does just face the camera

  2. Replace this item with a sprite

There’s no point in reinventing the wheel :slight_smile:

BTW: It’s looking fantasic! :slight_smile:

1 Like

Ah thanks. But its almost done. All thats needed is how to make the scale and the align code work at the same time?

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.