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. 

[Resolved] Checking raycast on multiple objects

Hello, I am working on a project where i want the player to interact with multiple objects, maybe hundreds. Where i can't find a solution is for the many different interactions. Here, for example, i have a key, the player can pick it up, there is a button that the player can press to activate a cutscene, a monster with dialogs, and there are sprites which shows some text on screen. But each object has to be activated when the raycast hits them. So when the raycast hits something, it has to check if it is one of the many blueprint classes and call their function. But i don't think checking for each class is a good idea, it doesn't look good and i can't find another way.. I can't loop because when i need to access the "Raycast Function" function inside of these blueprints, it requires a reference. So, if i had hundreds of interactions in the game, the blueprint would be massive and will check if the object is one of the others before.

alt text

Product Version: UE 4.22
raycast.png (202.5 kB)
more ▼

asked May 05 '19 at 11:15 AM in Blueprint Scripting

avatar image

33 3 3

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

1 answer: sort voted first
more ▼

answered May 05 '19 at 11:18 AM

avatar image

14.6k 76 25 61

avatar image WilfreGD May 05 '19 at 11:36 AM

Awesome! It works perfectly, thank you :)

(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