UE3 - UDK Get Distance Action Not Working

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Robject09

New Member
Nov 4, 2009
37
0
0
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.

PLEASE SOMEONE HELP!!! :(
 

Attachments

  • getdistance.bmp
    531.9 KB · Views: 52

Sjosz

(╯°□°)╯︵ ┻━┻
Dec 31, 2003
3,048
0
36
Edmonton, AB
www.dregsld.com
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.
 

Robject09

New Member
Nov 4, 2009
37
0
0
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!!!