# How to get 2nd trace to return to starting position without it giving a 0.0 distance?

Full disclaimer… I’m self teaching myself, but I’ve hit this stumbling block. From what I can tell I’ve had it shoot the trace from exactly center in my viewport, to the wall/object, and then from that point back to the center. But it gives me a 0.0 distance which, for my purposes, makes it difficult to set a “if distance <=” variable.

I’m essentially trying to create an unreal tournament style shield gun or impact hammer that will push the player the reverse angle it was aimed at. Although now that I think of it, angles might be an avenue to work with…

Alternatively if there’s an easier method to recreate the effect I’m all ears. Any push in the right direction would be appreciated, even if it’s just vague hints to get me over the hurdle.

Thanks,

Derek.

If I understand it right, you don’t need to calculate that reverse trace at all. The hammer will always push you backwards, because you hold it in front of you. So what you can do is calculate the distance to the wall, then get your camera’s forward vector and multiply it by -1, thus you’ll get the direction of the impulse that you have to apply to the character. Just multiply it by the impulse strength.

Alternatively you can take the first vector you get from the trace, normalize it and multiply it by -1 as well, you should get the same result.

Tuerer is completely correct from what I understand you are trying to achieve. Just incase you don’t know how, the best way (in my opinion) to do this would be to get the control rotation forward vector, normalise it, multiply by -1, multiply that by the force you want the character to bounce backwards with, then use the launch character node to push the character backwards. If this helps please accept the answer. If there are problems, feel free to ask questions. Good luck

Completely didn’t dawn on me that you can Launch Characters with a negative value to reverse the direction…