How do I make my beam weapon work properly?
I'm struggling to make my beam weapon work like it should. The beam particle is ready - it can go from one actor to another, if I want it to. It becomes more complicated, when I want it to go from my characters gun, to the point I'm pointing at. When using the blueprint I created, the beam comes out of the character and goes straight forward. It doesn't go up and down and isn't attached to the gun. Take a look at the screenshots for more info.
I'm a beginner when it comes to blueprints, so forgive me, if I'm doing some rookie mistakes. I'm asking for a solution, but an explanation would be very cool as well.
As you can see, the beam is supposed to go from the billboard I set up right in front of the gun (probably a bad idea, but I know no other way around this) and it's supossed to go where you're pointing at (just like the traces, that work). How do I deal with this?
asked Oct 05 '14 at 05:12 PM in Blueprint Scripting
After hours of testing, experimenting and playing around I finally managed to make a functional beam weapon! It took a lot of work but I'm happy to get one step further in developing my game and I hope that the attached pictures it will be of use to somebody, someday :)
And thank you for the good will, Erasio!
PS: The particle has it's source and target point "user set"
Ah actually not that big of a mistake. A really small one quite honestly but one which is not that obvious.
You are setting a location where the beam starts and then simply add a distance. This only works if you use the camera as spawn since the location you spawned your emitter is not in the middle of your camera and if you simply add a distance it will have the same offset your camera has in relation to your emitter.
To solve that simply remove the straight distance and do a trace for your camera. Whatever it hits is the location you want the beam target point to be so it will be in the middle of your screen. If it is further than your max range simply get the vector between that point and your current camera location, cut it at your max range and put the beam target range there.
answered Oct 06 '14 at 12:50 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here