Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

how to make a wind gun

Fairly new to unreal and not too good with blueprints yet. Does anybody know the blueprint for making a gun that does not fire anything that's physical but simply pushes back objects slowly like its a powerful fan ?

Product Version: Not Selected
more ▼

asked Nov 30 '14 at 12:15 PM in Blueprint Scripting

avatar image

1 1 1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first


I started working on it so here's what I did. It's far from perfect, but you can get started on it (if you haven't made it yourself yet, it's been almost a year). I also have different versions, I'll get back to that later on.

So for the first step, choose a button that will activate your wind gun, and create an event for it ("L" in my case). We need to apply force continuously, like wind does, and I achieved it by creating a timer, that will apply the force every 0.1 seconds, so it's works almost the same as if it was applied continuously. (This method may not be the best to achieve continuity, but I'm also a beginner, so this is what I could do.)

We also need to disable the timer, thus deactivating the wind gun. So as long as you press "L", your wind blows.

alt text

Now this timer calls a function called "WindGun" (in my case, you can name it sth else) every 0.1 seconds, so now we have to set up the function to apply force in a given direction. So now create a new function in the "My Blueprint" tab, and let's name it "WindGun" for now.

In the function window, drag off the execution pin and create a "LineTraceForObjects". Do it so you get the same result as on the image. This way, you "cast" your wind forward (the length of how far your wind blows objects in its was is defined in the "Wind distance" variable (I set it to 5000 I think). In the "Objects to Push Away" variable you can set what kind of objects you want to be affected by your wind. (I set it only to "Physicsbody".)

alt text

Again, do it so you get the same result. Here you set that if there is an object to affect in the way of your wind, you apply force to it. The force is defined by "Wind Force" variable. (set it to about 600.000 - 1.000.000 for starters)

alt text

And that's it. What you may want to experiment with is the radius of the wind, i.e. how you set up tracing. Right now, since it's a linetrace, the wind only works in that single line. If you want to make it bigger and have some radius to it, you should use for example capsuletrace instead. Then the wind affects object in the radius of the capsule that you cast forward.

Anyway, I think it's enough to get you started. If you have any questions about any part, feel free to ask.

windgun1.png (46.1 kB)
more ▼

answered Oct 28 '15 at 08:28 PM

avatar image

37 6 8 12

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question