Download

Shoot only through the X Axis

I am building a Side Scroller and I am working shooting currently. Right now where ever you click the projectile will be shot to that point in space. Meaning the if you shoot to the left but click on the back wall than the projectile will go towards the wall. How can I make it so the projectile will only travel on the X axis so it is on the path with the character.

Use a Make Vector node. Then hook up the XYZ inputs using the Y location of your character and the X and Z location of the Break Hit Result > Location vector. Then hook up the created vector to the “To” input of the Get Vector Direction node.

When I try to hook up anything it says that it is not compatible because the Make Vector node has floats of x, y, and z while the Location gives off a vector. Amy way of fixing this?

use a Break Vector node

Thanks so much, its working now!