Draw line between two actors and get its length

I want to make a camera similar to fighting games but it can also change its position and rotation depending on how far the characters are from each other.

I havent found any tutorial on how to make something similar to this so as far as i can guess im gonna need to create an invisible actor(or something) thats placed in the middle of a line between the two characters. And then i’ll need the length in order to set the camera arm distance and rotation since i want to make it look almost like a third person game when characters are really far apart.

Im a total noob so i have no idea how to make that line and get its length.

Hi alex,

check the image.
Simple setup, you may need to adjust some parts to fit your needs. (this is done on Event Tick)

The clamp is to get a min and max distance you can do this also over the spring arm length.

Also, this only sets the position of the camera, not the rotation for that you can use the “Find Look at Rotation” node.

gl :slight_smile:

1 Like

thanks a bunch my dude!

1 Like