x

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 create bullet spread?

I am just starting out in ue4 and i have no idea how to create bullet spread. At the moment i am spawning the bullet actor with the transformation of the camera that i am looking through so that it is spawned right in the middle. However, i would like the to spawn the actor in random locations along the camera to create the illusion of bullet spread.

Product Version: Not Selected
Tags:
more ▼

asked Apr 11 '19 at 08:56 PM in Blueprint Scripting

avatar image

pabolo12345
3 1 1

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

1 answer: sort voted first

i would like the to spawn the actor in random locations along the camera

if thats the case then you would just need to add a certain amount to your current spawn location. basically you take the spawn location you have then use a vector + vector, for the second value you will want to drag off the pin (drag left) and search for make vector. then for each of the y and Z plug in a random float in range, for the random you will want a min of say -30 and a max of 30 (you will need to tweak the values to your liking).

with all that said bullet spread is usually done for spread at distance, think shotgun where projectiles being at one point and spread as they move. since your spawning a projectile actor and presumably its just moving forward like the first person template, you would just need to add a slight adjustment to the rotation instead of location. it will be basically the same process as above but with rotators instead of vectors.

Edit: added picture. note i was working with third person so i added a little script to spawn the projectile in front of the character.

alt text

capture.png (182.1 kB)
more ▼

answered Apr 11 '19 at 09:44 PM

avatar image

ThompsonN13
10.1k 33 10 25

(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