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 calculate bullet's fly trajectory?

I really would like to teach bot to fire at long distances. Do anybody know how to calculate or/and draw bullet's trajectory (bullet has default physics).

Product Version: UE 4.19
more ▼

asked Jul 11 '18 at 08:30 AM in Blueprint Scripting

avatar image

1 1

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

2 answers: sort voted first

You can use a spline mesh component that will reduce the height of each point as they get further from the player, based on a bullet drop strength you can define.

You can also use this spline to move a bullet-sized colliding actor along the spline to determine where a blocking hit will occur. Similar to a line-trace, but arcing. This also allows you to draw something along the spline to show where the bullet will travel before you fire (assuming nothing gets in the way between the time the bullet is fired and it reaches its target). This draw can be scaled between the AI and the colliding location determined by the spline collision check.

EDIT: I am advocating that you move the bullet along the predetermined spline, rather than rely on physics/gravity to bring the bullet down, purely for accuracy of determination.

more ▼

answered Jul 11 '18 at 09:38 AM

avatar image

104 1 1 4

Can you describe your method more detailed? I'm beginner in using unreal engine, so I can not sort out splines on my own. Also english is not my primary language. Thank you very much!!!

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

Hey @RenegadeCash436, I think I have a tutorial that will help you figure most of this out. You probably will need to modify some stuff for your particular purposes not sure what you mean exactly by "teach a bot to fire at long distance" but this tutorial will show you how to use physics trajectories to create an arched path for a projectile, how to add a tracer to that path to show where it will land and there is an extra tutorial showing you how to draw out the arc path if you desire. I have linked you to the first video. Hope this helps.


more ▼

answered Jul 11 '18 at 10:32 PM

avatar image

Nebula Games Inc
2.2k 11 8 8

Thanks, my problem now is partly solved!

(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