Node for detecting if actor is colliding
I am having some difficulty with collisions, I have an actor that i can drag around the screen with the mouse and I need a way to check if it is colliding with something. Currently it seems the only methods of collision detection in blueprint are via event nodes. I need a way to check if the current actor is colliding with anything as a node, not an event, so I can add logic to this. (e.g. if isColling apply red texture else apply green texture).
Additionally my actor won't trigger onHit or on actor overlap events. I am using the shape_cube starter content mesh in my blueprint as a static mesh component, made sure all the collisions were set up to block all as type world dynamic. And when I move the actor I use set actor transform with the sweep option set to true. Am I missing a step?
asked Jan 12 '15 at 12:54 PM in Blueprint Scripting
On hit will only trigger if you have "Generate Hit events" on which is a check box right above the actual collision sets.
Additionally you will have to make sure that all other actors have in their collision settings overlap or block set under "world dynamic".
To check for collision you would usually do a line trace (this is a node). You provide a start point and an end point and it will basically draw a line between those two. If it happens to hit something while doing this it will provide a hit result which you can break to get the actor it collided with, where it hit something, what normal it had and a few other things.
I hope this helps.
answered Jan 12 '15 at 01:29 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here