Download

Set scale 3d for an Actor based on distance to player

So I’ve been racking my head on how to figure out this formula…

I can obviously smoothly scale an actor in the world using interpto and event tick for testing. However, I’m trying to figure out a formula so that I can increase the scale of an actor as I get closer and decrease as I get farther away (clamping to min and max scale vectors).

So if I have the distance to player (vector length), how can I smoothly set scale 3d based on distance to player as the player moves?

I’ve been working on something like this and this is what I got

Cool, thanks for linking that. Now in your example, when you’re between the A and B, what happens when you are not moving? does it scale up even if you’re not moving? I’m trying to make it so that it’s incremental increase or decrease as the player moves and vector length is increasing or decreasing.

Thats how my example works. The scale changes as you move between A and B so if you are still then it will stay at whatever scale it was the last time it updated. With my example if you are within a certain radius of the object that is being scaled it doesn’t change, if you want to get rid of that just take out the -200 node.

I have tried a simple function of Set World Scale 3D
maybe it can work
Here the guide
https://api.unrealengine.com/INT/BlueprintAPI/Utilities/Transformation/SetWorldScale3D/index.html​​​​​​​

Captura_02.PNG