I’m trying to find a point between my character’s location, and a targeted pawn’s location. I want the location between to be calculated by subtracting a certain amount from the pawns current location.
Ive tried just subtracting a flat number from x and y but that ends up making a fixed location that doesnt change even when my character changes his location.
Im assuming this starts with GetUnitDirectionVector, but I just can figure out how to calculate the middle point by subtracting.
My character is supposed to jump to that point and I want him to land basically X distance before the pawn from any direction he approaches from
ok so what exactly is happening: SphereOverlap sphere scans for pawns. I get the location of the first pawn in that array. I then want my character to land in front of the pawn X units before the pawns world vector location, so my guy doesnt glitch into his model. I kind of figured it out, but for some reason my character doesnt land in the same spot everytime even though the pawns location is constant. It seems like the radius of the sphereoverlap is affecting where he lands which is strange.
Yeah i should have never once used the word middle in this question and I realize that now. I didnt mean the dead middle of the 2 locations. I mean a point that was certain units back from the pawn location which I assume needs to be subtracted but i dont know how
Well Its half working i think. It doesnt seem like changing that float value does anything though. He keeps jumping just in front of the pawn. When I increase that he doesnt move back or forward any.
Sorry i dont want to lead you on a wild goose chase. I appreciate the help. Im using SetActorLocation as the final node thats taking this vector information
Ok yeah thats the results I was looking for. Perfect. Also ONE last thing if you can.
Im running that vector value into a lerp as value ‘B’ and my characters current location as value ‘A’
I also have a timeline that is increasing and dictating the value of ‘Alpha’ on the lerp.
For some reason the further you are away from the pawn with this timeline and lerp, he lands slightly further back and not in the same consistent spot like he does without the lerp.
Do you know whats causing this?
I want the character to travel over time to that final point rather than teleporting.
you know what I think I got sometthing thats close enough to what I wanted. I just reduced the Timeline value at 1 second to like .15. That slows the movement down. He doesnt land in EXACTLY the same spot everytime but its close enough I think. I guess if you have a suggestion thats better Im all ears, but thank you so much for your time and help!!!
There are 2 things I can think of that might cause different landing location:
If the character root transform and the target root transform are on very different heights the distance will be sloped since the vector is fixed length in 3D. The further away the character and the target are, the closer to the horizontal distance the vector will be. The way around this is to remove the Z components when you take the positions.
The timeline points might not be at exactly (0,0) and (1,1). Double check them by selecting them and typing the positions if needed.