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 make grenade land at crosshairs?

I want to make a grenade throw system that accomplishes three things:

  1. grenade must simulate physics

  2. grenade must always land at the location in the world that the crosshairs are pointing at

  3. the character throws the grenade from a location not on the line to the crosshairs

I need to somehow find the vector and force at which to launch the grenade. Any ideas?

Product Version: UE 4.19
Tags:
more ▼

asked Apr 17 '18 at 01:47 AM in Blueprint Scripting

avatar image

aqkotz
144 2 8 10

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

2 answers: sort voted first

You'll need grenade start toss location, end location, which you can get from projecting screen space to world space. And function SuggestProjectileVelocity which calculate direction and speed for your grenade to land at the desired position.

more ▼

answered Apr 17 '18 at 11:45 AM

avatar image

MrMcKvarz
241 2 6 15

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

Thank you! That worked perfectly.

more ▼

answered Apr 18 '18 at 01:04 PM

avatar image

aqkotz
144 2 8 10

(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