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 can I set the correct rotation for bullet impacts?

Hey guys, I have a complete set of bullet impact effects and I have them working very well with a line trace. They always spawn when I shoot an object, However, sometimes the impacts will not appear correctly. Sometimes when I shoot an object, a wall for example, the particle effect will spawn out the other side of the wall that is facing away from me. And shooting boxes normally allows for 1 to 2 sides that allow for correct rotation of these effects, but the rest of the sides make the emitter spawn inward and the effect is lost within the cube. Is there a way to perhaps get the rotation of the face that I am shooting and always force the emitter to spawn correctly? Thanks a lot!

Product Version: UE 4.10
more ▼

asked Mar 07 '16 at 02:06 PM in Blueprint Scripting

avatar image

190 35 29 54

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

it depends on how you're creating your bullets. if you're using a line trace, then break the struct of the 'hit' value returned from the line trace, and you can use hit normal to build a rotator. if you're using projectiles that spawn and impact (for slower projectiles), you'll need to get hit event and break out the struct with the hit info for the hit normal. if you are spawning projectiles for a bullet, this might not be the best approach performance wise, but be sure to use continuous collision detection if you need to use this approach for whatever reason.

more ▼

answered Mar 07 '16 at 03:25 PM

avatar image

1.2k 49 31 87

avatar image Anaklosmos Mar 07 '16 at 04:11 PM

So I have used this make rot from XY and its working rather well for the most part. However, sometimes, depending on the emitter, it will still spawn the emitter out of the wrong side of the object. Below I have attached a picture of the error that I am getting where the emitter spawns on the wrong side and my blueprint for the spawning of the emitter itself. As you can see, I could not get an action shot, but the dirt has appeared on the left side of the cube after I had shot the right side.

alt text

alt text

untitled-6.png (929.5 kB)
untitled-8.png (123.2 kB)
avatar image paradoc Mar 07 '16 at 04:27 PM

if this behavior only occurs with certain emitters, you may want to check your emitter's properties in terms of the actual spawning direction of the particles, initial velocity, etc.

alternatively, instead of using the impact hit data, you could also test against a different vector like the trajectory of the bullet trace. so impact location would be the same, but for rotation, just use your bullet trajectory mirrored or something. in theory, hit normal should be the same as bullet trajectory, but if you're getting odd results here, it doesn't hurt to test against the bullet trajectory anyhow.

avatar image Anaklosmos Mar 07 '16 at 05:32 PM

Alright! Thanks so much for the help! I have simply decided that it may be the emitter, so I will simply use different ones. It worked great otherwise!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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