View Full Version : UE3 - UDK Get Distance Action Not Working

8th Jun 2011, 02:28 PM
Right well I can't for the life of me figure out why this isn't working. I am trying to get a camera animation to occur only when the player is within a certain distance from a skeletal mesh I have emmerging from the centre of the level.

I've been at this for over half an hour, trying different methods and using extra actions to get this to work and from the looks of things there is no reason it shouldn't. I have been teaching myself Unreal mainly using logic, trial and error so hopefully I am just missing something obvious to another.

I have attached a screen cap of the sequence in the simplest form I've tested using and have circled the "get distance" action and float comparison in red.

If no one knows what the problem is then is there a way to see, when running the game in editor, what the output of the float variable I am using is... then I can at least see what the "get distance" action is calculating the distance as.


8th Jun 2011, 03:49 PM
1) From what I can see, the logic you have set up looks fine, except for the fact that it's set up to only check distance once. You need a looping check there. Your logic executes just fine, but only on Level Startup, and if your starting position is out of range, then it will correctly choose to not pass through the float comparison.

2) Hold down L on your kismet canvas and left-click with your mouse. This'll place a log action. Insert the log action in your regular chain of logic (probably best between 'get distance' and your float comparison), and attach the float pin of the log action (you may have to expose it) to the same float variable that 'get distance' outputs.

9th Jun 2011, 11:30 AM
Thank you so so much!!! That log action has totally saved my life and is gna be a massive help for some of the other minor probs I have going through the game :D The problem turned out to be the units measuring the distance between the objects. I was basing my calculations on the values produced by dragging the red line out in a viewport (holding the middle mouse button) but the actual units used in the calculation are randomly displaced by about 2,000 for some reason.

Either way it works fine now :)

Thanks again!!!

22nd Aug 2012, 04:17 PM
Hey thanks guys this really helped out. XD