Since 4.7 function “get distance to” has no execution pin. This is caused by this change which I have found in changelog:
New: When blueprint functions that
change from impure to pure, the
execution pins in the graph will
automatically update to maintain the
execution flow.
Several Actor class
functions became pure (Get Distance
To, etc.)
Problem is I used that funtion for major feature in my game, so now I will have to find workaround.
Is there a way to change this funtion locally to unpure (with execution pins) through C++?
I just encountered this myself. When I create “get distance to” there are no execution pins. Is there a way to fix this on my end? Help is greatly appreciated!
I have found a workaround for that. I attached screenshots from 4.6 and 4.7. As you can see in 4.7 I had to make more scripting to achieve same result. The goal is to get constantly distance between player and point, with certain small intervals.
Just create a new function with the same inputs and outputs as the original. Pass the function’s inputs into the pure function and the pure function’s output into your function’s output.
To create a function library, right click in your assets, scroll down to blueprints, and in the new menu, click function library.
In general I would not use a delay in that code.
For clarity i would make a function that looked something like this:
It may very well be the case that you call this function every frame, or use a delay in some other code to only call it once a second.
That may look like: