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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

TPS: Muzzle boom to collision tracked by crosshair

Is it possible to put a boom from the end of a barrel that extends to first collision (or set distance if not collision) and then have a crosshair move about the screen tracking it?

I am creating a TPS and I am wanting to also swap camera from left to right shoulder which I have figured out, but this causes issues with my crosshair and my above question is how I would like to go about resolving it, if possible.

Thanks!

Product Version: UE 4.21 Preview
Tags:
more ▼

asked Oct 29 '18 at 07:10 AM in Blueprint Scripting

avatar image

usurperquaid
23 2 4

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

1 answer: sort voted first

Are you familiar with traces? If not, you might want to look them up. They are insanely useful and there are many kinds.

You can set up a trace that runs from the end of your gun component to X amount of distance away from it's forward vector. When it hits something, it returns something called a hit struct. You can split this struct up into a many different things, one of them being the hit location of what it just hit (which will be a vector).

You can then plug this vector into a node called "Convert World Location to Screen Location" which will give you 2D coordinates for you to use in a UMG widget or HUD BP for your crosshairs.

more ▼

answered Oct 29 '18 at 09:39 AM

avatar image

PixelOmen
612 21 15 35

avatar image usurperquaid Oct 30 '18 at 01:31 AM

Thanks! I was able to follow the idea and will look into the steps of that process!

avatar image PixelOmen Oct 30 '18 at 03:22 AM

No problem. Be sure to sure to mark my post as the answer if it answered your question. Otherwise, let me know if you have any other questions.

(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