Hi all. Am fairly new to this, and am picking things up as i go, but must have missed something basic and cant work this one out. almost embarrasing but hope someone can help me
I am setting a variable that holds distance between my player pawn and an external object - this is working well using “get horizontal distance to”.
I want to find two variables. - Its position at the start, when i called the function, and its position currently as it moves… but i cant work out how to get the value it began at.
So yeah, a very simple question, hopefully with a simple answer.
Make a Vector variable and when you want to get the start position, when you call the function or whatever, get actor location, save to the new variable. Current position is get actor location.
I’m not sure if you mean when you say “at the start, when I call the function” if you mean when you call the function, or at the start of the game, and you get that info when you call the function. I assume the latter.
So assuming that, on the actor you want to get it’s position, on begin play set vector variable to it’s Get Actor Location.
On the actor you want to tell the two locations, get a reference to the external object, cast it to whatever class it is, get it’s vector variable that you set, and get actor location to get it’s current location