I have created a weapon blueprint using blueprint.
The custom event i created work but the line trace fires in other direction then where i look.
Here is an example and the blueprint i use. In the green circle you can see it fires to the right, when i turn 180 degrees it fires left.
Easy mistake to make. Don’t multiply the vector. Add it. You have the location of your weapon socket. You calculated the trace (forward 5000 units) but now you have to add it to extend it on top of the location. Multiply will multiply each value in this vector (which exists of 3 floats) by the one of the other vector.
Hi there,
Thanks again, I copied the bp components to my character and now it fires the correct direction!
But the only problem that i fires the right direction im looking but not up of down.
Well that’s due to the way you use the “Get Forward Vector”. This provides you with the forward vector of your actor (character in this case). It doesn’t change with where you look. You can get the camera and use it’s forward vector to always have the exact middle of the screen. It will shoot slightly below where you’re looking (by the amount of units your gun is actually below your camera) but in the right direction.