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"

Do line traces generate hit events?

I'm participating in a small game jam to do with mirrors, and while bashing out a prototype for my idea I've hit a snag to do with line tracing. The final product will probably not have or need line tracing but it's probably the easiest thing to test with currently.

Anyway, the idea is to have the mirror bounce whatever hits it in the opposite direction (think of it as one of those laser puzzles), I tried to do this with some loop logic with my wizard character who's supposed to be shooting the things that'll bounce off these mirrors, but I ran into some problems to do with infinite looping, so I thought to let the mirrors themselves handle the hit logic, so when the mirror gets hit with the raytrace, I'll use OnComponentHit to handle the bouncing, but the initial ray trace doesn't seem to generate a hit event on whatever the cast hits. Is there a way to force it to happen?

My code is just a simple line trace by channel but I'll include it anyway. Just using the impact point of the hit to reverse the normal to generate a new direction for the new line trace, as you can see I've set a break point there but it never gets triggered, and I can't find something in the editor itself that indicates whether a component can have a hit result generated by a line trace.

Product Version: UE 4.16
Tags:
more ▼

asked Jun 02 '17 at 05:02 PM in Blueprint Scripting

avatar image

Kyle_Katarn
8 2 3 7

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

1 answer: sort voted first

I ended up writing my own function instead of using OnComponentHit. That will probably be useful for when I implement fireballs and actual projectiles and the like but it wasn't what I needed here. So I wrote my own function and passed the hit result from the initial line trace into it and worked from there to get the proper relfection bouncing working.

more ▼

answered Jun 04 '17 at 07:24 AM

avatar image

Kyle_Katarn
8 2 3 7

avatar image PlentoTheMan Sep 12 '17 at 12:44 AM

How about posting your solution to help others with the same problem :)

(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